jQuery-slimScroll
jQuery-slimScroll copied to clipboard
Uncaught ReferenceError: t is not defined
I get the error when I drag the scrollbar. I looked into it a bit, here's the problem:
if (o.railDraggable){
bar.bind("mousedown", function(e) {
var $doc = $(document);
isDragg = true;
_t = parseFloat(bar.css('top'));_
_pageY = e.pageY;_
$doc.bind("mousemove.slimscroll", function(e){
_currTop = t + e.pageY - pageY;_
bar.css('top', currTop);
scrollContent(0, bar.position().top, false);// scroll content
});
In the snippet above, vars t, pageY and currTop have not been defined with 'var' .
In my code 'use strict' is getting applied globally hence I'm getting the error. When I pre-prended these vars with 'var', it worked fine.
some news on this issue?
+1 on this issue. I'm facing the same thing.
If anyone faced this issue using webpack, here is a hack that solved the problem: Install a script-loader and add the next line:
require('!script!../static/js/jquery.slimscroll.min.js');
PS. this is not a recommended way of doing this, so don't ask me why I had to come up with this.