check insane timeout - Cycle Plugin

check insane timeout - Cycle Plugin

Certain combinations of timeout and speed can break the shuffle effect, for example when (timeout, speed) = (1000, 600). I took a quick look at jquery.cycle.all.js, and found a potential fix:

  1.   while((opts.timeout - opts.speed) < (opts.fx == "shuffle" ? 500 : 250)) // sanitize timeout
  2.    opts.timeout += opts.speed;

The original code was:

  1.   while((opts.timeout - opts.speed) < 250) // sanitize timeout
  2.    opts.timeout += opts.speed;

I did limited testing and the fix worked. I only had a very quick look at the source code, and there might be better ways.