4

I'm adding content dynamically into my jScrollPane DIV, and I've finally made it expand the pane height or get rid of it depending on the amount of content, however I need it in this instance not to scroll back up to the top every time something is added or subracted. I need it to stay put.

Here is the code I am using to reinitialize the jScrollPane at the moment:

function refreshNav() {
        var top = $('#my_scroller').css('top');
        $('#infohome').jScrollPaneRemove();
        if (page == "enquiryform"){
            $('#infohome').css('height','550px')
        }
        else {
            $('#infohome').css('height','284px')
        }
        $('#infohome').jScrollPane();
        $('#infohome').css('top',top);
        $('.jScrollPane').css('height','100%');

}

I have already tried getting rid of all the code relating to 'top' but it doesn't seem to make a difference.

tbc0
  • 1,563
  • 1
  • 17
  • 21
Mr.2
  • 155
  • 9
  • Are you removing and re-adding the jScrollPane object? Is it not possible to add the dynamic content into the object without removing it and then, if need be, resize it? – Calavoow Oct 08 '12 at 14:13

1 Answers1

0

I think the best solution is stop using jScrollPane and use nanoScroller instead. :)

emmgfx
  • 573
  • 7
  • 17