Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7176459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:30:40+00:00 2026-05-28T16:30:40+00:00

I have dynatree with fixed height and vertical scrollbar. node.activate(); selects the node i’m

  • 0

I have dynatree with fixed height and vertical scrollbar.

node.activate(); selects the node i’m searching for, but doesnt move the vertical scrollbar, so i have to scroll manualy to see active node.

How do i scroll it programmaticlly?


Thanks to mar10, I solved this problem:

var activeLi = node.li;
$('#tree').animate({
    scrollTop: $(activeLi).offset().top - $('#tree').offset().top + $('#tree').scrollTop()
}, 'slow');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:30:42+00:00Added an answer on May 28, 2026 at 4:30 pm

    Dynatree does not have a built-in scrollTo functionality.
    But you should be able to use one of the existing methods and plugins, once you have the DOM element that you want to make visible.

    In your case, you already seem to have a node object, so you can get the the associated <li> and <span> tag using node.li or node.span.

    In general you can get the active node at any time by calling

    var node = $("#tree").dynatree("getActiveNode");
    // or
    var node = $("#tree").dynatree("getTree").getActiveNode();
    

    then get the associated DOM element:

    var activeLI = node && node.li;
    

    or handle the activation event:

    onActivate: function(node) {
        var activeLI = node.li;
        ...
    }
    

    Once you have the element, use a standard method:

    Scroll to a div using jquery ,
    jQuery scroll to element ,
    How to scroll to an element in jQuery? ,
    …

    Edit 2014-05 Starting with Fancytree 2.0 autoScroll was added as a standard option.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use dynatree and everything works fine but if a node has large number
Have looked so long for a library specialized in dealing with iPhone Accelerometer but
My problem is whenever I left click a dynatree node then right click another
Have converted devise new session from erb to Haml but doens't work, this is
Have any one tried to activate fancybox thumbnail gallery using a button or an
Using Firebug I have found that the Dynatree plugin changes the following code: <li
Have the following code. The height is variable so the height of the floating
Have a large amount of HTML, but where I thought the bottleneck would be
Have been scatching my head about this - and I reckon it's simple but
I have an array of functions and also I am using a dynatree plugin

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.