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.