google-code-export / jscrollpane

Automatically exported from code.google.com/p/jscrollpane
1 stars 0 forks source link

Resizing scrollpane ends up with wrong pane height #227

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Put thumbnails into the scrollpane whose summed up height is larger than the 
scrollpane height.
2. Scroll down to the last clickable thumbnail and click it.
3. Enlarge browser window, scroll down to the last thumbnail again and click it.

What is the expected output? What do you see instead?
I expect the scrollpane not to change at all. Instead the last thumbnail gets 
moved by some pixels to the top and the space below is just empty.

What version of the jScrollPane are you using? On what browser? And operating 
system?
jScrollpane 1.2.3 r93, FF 3.5.6, jQuery 1.4.2-min

Please provide a URL to a page displaying the problem.
http://alexandraklever.de/jscrollpane/test.php

Please provide any additional information below.
I want to resize the scrollpane height according to the current browser window 
size. I therefore remove and re-init the scrollpane everytime the 'resize' 
event is catched.
The problem is: I made some variable outputs and it seems as if the paneHeight 
variable is reset on some point back to the initial/previous paneHeight. 
I have therefore tried to kill all processes that are executed in an interval 
(and running in the background). I therefore added two global arrays that 
stored all interval processes formerly stored to _animateToInterval and 
_animateToPosition. And on $.fn.jScrollPaneRemove i called 

while ($.jScrollPane.animateToInterval.length > 0) {
    clearInterval($.jScrollPane.animateToInterval[0]);
    delete $.jScrollPane.animateToPosition[0];
    $.jScrollPane.animateToInterval.splice(0,1);
    $.jScrollPane.animateToPosition.splice(0,1);
}

where animateToInterval and animateToPosition are the global arrays. But this 
did not have an effect (i removed it for the minimal example on test.php).

For debugging purpose i have added an output of paneHeight in the scrollTo 
function which can be seen on the right side of the scrollpane. There you will 
notice the reset of paneHeight.

To have the bug very clearly, initialise the browser with a very small window 
size and when having clicked the last thumbnail enlarge the window to a 
noticeable larger size. Then click on the last thumbnail again and you'll see 
the jump.

Thanks for any advice or help (i am sitting on this bug for days now)!

Original issue reported on code.google.com by trash4va...@gmail.com on 20 Sep 2010 at 4:42

GoogleCodeExporter commented 9 years ago
Hi,

Please try the new beta of jScrollPane:
http://jscrollpane.kelvinluck.com/

That should make your life easier as all of the code to handle change of the 
browser window size can be dealt with inside jScrollPane itself.

If you have problems with that version of the script then please send a message 
to the jScrollPane google group:
http://groups.google.com/group/jscrollpane/

Thanks!

Kelvin :)

Original comment by kelvin.l...@gmail.com on 20 Sep 2010 at 7:02