height of document sometimes calculated inaccurately

44 views
Skip to first unread message

Tinyfish

unread,
Aug 31, 2010, 7:11:04 AM8/31/10
to jscrollpane
sometimes, the pane.outerHeight() which gives the height of the whole
document that is being scrolled gets calculated too short, and the
last page of the document cannot be scrolled to. It seems to be
easiest to reproduce with more than two pages worth of text when the
pane is over half the height of the browser window. I made it happen
on Chrome (although I have had it happen on Firefox and Opera too) by
shrinking the whole browser window by pulling down the top of the
browser.
Message has been deleted

Kelvin Luck

unread,
Aug 31, 2010, 12:05:33 PM8/31/10
to jscro...@googlegroups.com
Hi,

Do you have an example URL showing this problem happening? Is your CSS
included above your JS in the head of your document?

Thanks,

Kelvin :)

Tinyfish

unread,
Aug 31, 2010, 12:46:33 PM8/31/10
to jscrollpane
ok, I've stripped out almost everything else...

http://www.menaredead.org.uk/test/biog/xxx_biog_history.htm

happened immediately in Safari, but you may need to try resizing the
window and refreshing in whichever browser. Seems to be dependent on
the height of the browser in some weird way. And yes, CSS is all
included above JS.

Kelvin Luck

unread,
Aug 31, 2010, 1:02:21 PM8/31/10
to jscro...@googlegroups.com
Thanks for the testcase. I can verify that it the content height is being
calculated incorrectly in both Safari and Chrome (both webkit based) on my
mac... I couldn't make it happen in Firefox though. At a guess the problem
is caused by the absolute positioning with both bottom: and height:
defined on your #content element.

I will try to investigate further and will get back to you when I figure
something out. If you want a quick workaround you could try putting an
additional element inside the #content div and applying jScrollPane to
that element instead of directly to #content (but please leave that
example page as-is until I get a chance to take a better look at it),

Cheers,

Kelvin :)

Tinyfish

unread,
Aug 31, 2010, 1:23:03 PM8/31/10
to jscrollpane
Thanks for getting back so quick!

I'm afraid that wrapping the element and scrollpaning that wrapper
instead didn't work :/

Kelvin Luck

unread,
Sep 2, 2010, 4:42:55 AM9/2/10
to jscro...@googlegroups.com
Hi,

I've added an issue to github and the example code here:
http://github.com/vitch/jScrollPane/issues/#issue/12

There is some additional comments on the issue so please read that for
further information...

Cheers,

Kelvin :)

Kelvin Luck

unread,
Sep 13, 2010, 12:55:35 PM9/13/10
to jscro...@googlegroups.com
This issue has been resolved with the latest beta of jScrollPane,
please see:

http://jscrollpane.kelvinluck.com/issues/12/after.html

Kelvin Luck

unread,
Sep 13, 2010, 1:22:27 PM9/13/10
to jscro...@googlegroups.com
Actually, I spoke too soon. I missed that this problem was happening
especially in Webkit and I implemented a fix for part of the problem
(the incorrectly calculated width) but not for the incorrectly
calculated height).

One workaround is to set autoReinitialise to true. This means that once
the height can be calculated correctly it is. I've added an example
showing this here:

http://jscrollpane.kelvinluck.com/issues/12/after_reinit.html

Reply all
Reply to author
Forward
0 new messages