jijo-paulose / jscrollpane

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

Jquery version problem #269

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Jscrollpane is throwing "Uncaught TypeError: Cannot read property 'top' of null 
" on Chrome on line:

              currentOffset.top -= dragPosition;

This happens with jquery version 1.6.1 in Chrome and Firefox, but ok with IE 7.
Jquery version 1.7.2 does not work with any of them.
Jquery version 1.4.2 works fine.

Original issue reported on code.google.com by claudiogabrielgambone@gmail.com on 23 Jul 2012 at 3:04

GoogleCodeExporter commented 9 years ago
This is because the script initializes a few elements using the attribute 
"className" instead of "class". Which is the js/dom equivalent of the HTML 
class attribute. 
Since jQuery > 1.7 ( maybe 1.6 as well? ) the attributes are strictly used for 
generating HTML, so setting the "className" property actually generates 
something like this: <a classname="" />

Replacing all occurrences of "className" to "class" thus fixes the problem. 

Attached is an updated version.

Original comment by Jaap.Moo...@gmail.com on 24 Jul 2012 at 7:03

Attachments:

GoogleCodeExporter commented 9 years ago
That problem is with the (very) old version 1.x of jScrollPane. Please use 
version 2.x instead:

http://jscrollpane.kelvinluck.com/

Original comment by kelvin.l...@gmail.com on 24 Jul 2012 at 8:09

GoogleCodeExporter commented 9 years ago
Thank you Jaap.Moo...@gmail.com it works now!

Original comment by sopov...@gmail.com on 17 Oct 2012 at 12:38