Quick Fix for jQuery Nivo Slider Random Effect Problem

I was using the awesome jQuery Nivo Slider for one of our projects today and I had a problem. If you use the effects setting with random option the slider starts acting weird. After watching it carefully I realized that some of the effects were buggy and were causing the problem.

The easiest fix without wasting too much time on it is to change the animations array where that random option gets the animations to play.  You’ll have to use the uncompressed development version to make the changes. If you downloaded packed production version you’ll have to download the production version separately.

Open the file jquery.nivo.slider.js in your favorite text editor. Go to line 309 and remove all effects that has anything to do with “up”. Namely, remove “sliceUpRight”,”sliceUpLeft”,”sliceUpDown”,”sliceUpDownLeft” portion of the array. I couldn’t figure out which one of these effects was causing the problem so I ended up removing all of them. The rest of the effects seem to be doing a good job and I think I can live with that!

Here are the before and after pictures to make it clearer for everyone.

Or you can just copy and paste the corrected code from below:

if(settings.effect == 'random'){
var anims = new Array("sliceDownRight","sliceDownLeft","fold","fade");
vars.randAnim = anims[Math.floor(Math.random()*(anims.length + 1))];
if(vars.randAnim == undefined) vars.randAnim = 'fade';
}

If anybody figures out the real solution to this problem please make a comment below and let us know too.

This entry was posted in jQuery and tagged , . Bookmark the permalink.

4 Responses to Quick Fix for jQuery Nivo Slider Random Effect Problem

  1. Pingback: Alexander

  2. Pingback: Alexander1

  3. Pingback: Alexander6

  4. Pingback: Alexander7

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>