开发者

How to start/stop CrossSlide (jQuery)

I found that CrossSlide causes video playback on the same page to s开发者_开发问答tutter quite badly. My thought was to have the cross slide effect on the same page stop or pause during video play back, annd then start again when video stops.

Id doesn't look like there is any start stop function included. Does any one know how I might be able to accomplish this?

Thanks.


I've tried to use stop on the CrossSlide homepage at http://www.gruppo4.com/~tobia/cross-slide.shtml. Doesn't work.

I tried an improvised method, that is using sleep set to a very large value. The down-side is the slides have to revert to the first frame upon calling it and resuming.

On that page, using Firebug to run the exact same crossSlide call except for sleep:

$('#test1').crossSlide({
  sleep: 100000, // <--- this one
  fade: 1
}, [
  { src: 'lib/sand-castle.jpeg', dir: 'up'   },
  { src: 'lib/sunflower.jpeg',   dir: 'down' }, // remaining slides doesn't really matter
  { src: 'lib/flip-flops.jpeg',  dir: 'up'   },
  { src: 'lib/rubber-ring.jpeg', dir: 'down' }
]);

To resume:

$('#test1').crossSlide({
  speed: 45, // <--- this one
  fade: 1
}, [
  { src: 'lib/sand-castle.jpeg', dir: 'up'   },
  { src: 'lib/sunflower.jpeg',   dir: 'down' },
  { src: 'lib/flip-flops.jpeg',  dir: 'up'   },
  { src: 'lib/rubber-ring.jpeg', dir: 'down' }
]);

Note: You can't use sleep and speed together.


It looks like CrossSlide just uses $.animate() on img elements ---

have you tried $('#container img').stop(); ??


I wanted to stop CrossSlide and return the container back to its original state.

$('#container img').stop().hide('fast');  // worked for me!
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜