darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

$.noConflict(true); Uncaught TypeError: Cannot read property 'easing' of undefined #171

Closed markusfalk closed 9 years ago

markusfalk commented 9 years ago

When using Sly with jquery's noConflict I get an error.

// causes: Uncaught TypeError: Cannot read property 'easing' of undefined
$.noConflict(true);

I use requirejs (http://requirejs.org/docs/jquery.html#noconflictmap) but I don't think this is the root of the problem.

This is the line that has the undefined jQuery.

pos.cur = animation.from + animation.delta * jQuery.easing[o.easing](animation.time/o.speed, animation.time, 0, 1, o.speed);

Possible Solution? - Use the private $ instead of 'jQuery':

pos.cur = animation.from + animation.delta * $.easing[o.easing](animation.time/o.speed, animation.time, 0, 1, o.speed);
darsain commented 9 years ago

Good catch. I'l look at it when I'll have some time.

darsain commented 9 years ago

Fixed in cbfc3e09fc8ec899aa3ed60db303663679f3987e.