AlreadyM / jscrollpane

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

Webkit raises a TypeError: Cannot read property 'offsetHeight' of undefined #189

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
An archive demonstrating the bug is provided.

Webkit (safari and chrome), on mac OSX and windows, raises the following error :

jScrollPane.js, line 249 : Uncaught TypeError: Cannot read property 
'offsetHeight' of undefined

reproduced with jScrollPane-1.2.3

It appears that jQuery does not manage to resolve the child selector (“parent 
> child”), thus both 
"$track" and "$drag" are set to undefined values :

$track = $('>.jScrollPaneTrack', $container);
$drag = $('>.jScrollPaneTrack .jScrollPaneDrag', $container);

As a result, the scrollbar does not initialize, and simply does nothing
Replacing the previous lines with a "dumbed down" version fixes the issue :

$track = $container.children(".jScrollPaneTrack");
$drag = $track.children(".jScrollPaneDrag");

Enclosed :
- a screen shot
- the (dirty) hacked version fixing the issue
- a complete webpage displaying the issue

Original issue reported on code.google.com by benoit.k...@gmail.com on 22 Apr 2010 at 9:34

Attachments:

GoogleCodeExporter commented 9 years ago
I'm sorry for the crappy html code :-/

Original comment by benoit.k...@gmail.com on 22 Apr 2010 at 9:42

GoogleCodeExporter commented 9 years ago
Hi,

I think the problem is because you have the following on your #pane1 div style:

height: auto; width: 631px; padding-right: 20px; position: absolute; overflow-x:
visible; overflow-y: visible;

You shouldn't have all of this stuff, it is added dynamically by jScrollPane 
itself. 

Try doing it so that #pane1 doesn't have position:absolute and so that it has
overflow:auto.

Your change to the code won't work as it will misbehave when there is more than 
one
jScrollPane on a page...

Hope it helps,

Kelvin :)

p.s. In general it is much easier for me to debug with a URL to your page than 
it is
to download a zip file etc...

Original comment by kelvin.l...@gmail.com on 23 Apr 2010 at 7:19

GoogleCodeExporter commented 9 years ago
I have just announced the beta of a completely rewritten version of jScrollPane:

http://groups.google.com/group/jscrollpane/browse_thread/thread/c1bc1bf63e3f80d8

Please test and reply on the list if you are still having this issue,

Thanks,

Kelvin

Original comment by kelvin.l...@gmail.com on 17 Aug 2010 at 4:19

GoogleCodeExporter commented 9 years ago
I had similar issue with Webkit. Just declared the css higher in the stack than 
the js. Fixed it right away.

Original comment by jmgala...@gmail.com on 18 Aug 2010 at 12:18