NivoSlider not working smoothly on magento

早过忘川 提交于 2019-12-02 21:06:25

after some digging, I found the solution... and the solution is very simple: as simple as adding one little underscore character to nivoslider script. just replace this line on nivoslider script:

$.fn._reverse = [].reverse;

to this

$.fn._reverse = []._reverse;

And here is the explanation for those who need explanation:

if you see the error listing (with firefox, ctrl+shift+j) while using nivoslider, you will see that the prototype got too much recursion. This is the explanation of that "too much recursion" of Prototype: prototype too much recursion problem.

Usage of reverse function on Prototype has made conflict with NivoSlider. guys on github found this problem and give one quick solution here: https://github.com/gilbitron/Nivo-Slider/issues/35

this problem has drive me crazy, for there are no sufficient resource everywhere (try google it out and you'll find no direct answer to this problem). So I hope my question, along with my own answer could help other people out there with the same case with me :)

Started seeing this recently on a site that's been in dev for awhile. Seeing:

Uncaught RangeError: Maximum call stack size exceeded
Object.extend.reverse

in the console in Chrome. the 'Object.extend.reverse' detail references prototype line 881. I'm not much of a javascript guy, so this is a detail better suited for someone else.

/skin/frontend/gas/default/js/jquery.nivo.slider.pack.js is loaded in , so it's gotta be some conflict, maybe with new jQuery version or something.

I suppose you could switch to a different slider. I recently found BX slider and like it, though haven't used it on a Magento project yet, so can't speak for compatibility and you've fixed it anyway, so...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!