views:

197

answers:

1

scrollTo is not scrolling to a div that expands past the bottom of the page... any suggestions? (jQuery 1.3, scrollTo 1.42)

function toggleCollapsible(ownerDiv) {
    ownerDiv.next(".Collapsible").slideToggle("fast", 
                                              $.scrollTo(ownerDiv, "slow"));
}
+1  A: 

Tried your code and it works, but you forgot to specify, that $.scrollTo should be inside an anonymous function (callback after slideToggle finishes toggling) and it even scrolled to under bottom of page..

function toggleCollapsible(ownerDiv) {
    ownerDiv.next(".Collapsible").slideToggle("fast", function(){
        $.scrollTo(ownerDiv, "slow");
    });
}
toggleCollapsible($("#target"));
Juraj Blahunka