Coffeescript Image switcher?
Can anyone give me an example of how to making an image switcher using coffeescript? I just have 3 开发者_如何学运维images I want to fade in and out, but I couldn't find any tutorials for this.
Thanks
There are plenty of good jQuery plugins for this, e.g. http://jquery.malsup.com/cycle/
With that plugin, you just put all of your <img>
tags in a <div>
—let's say it has the id images
—and then you can simply write
$ ->
$('#images').cycle fx: 'fade'
精彩评论