Skip to content

Instantly share code, notes, and snippets.

@gogogarrett
Created March 14, 2013 21:24
Show Gist options
  • Select an option

  • Save gogogarrett/5165418 to your computer and use it in GitHub Desktop.

Select an option

Save gogogarrett/5165418 to your computer and use it in GitHub Desktop.
SlideShow =
current_image: 0,
max_images: 0,
init: ->
$slideshow = $('#slideshow > div ul')
$slideshow.find('li').hide().eq(0).show()
this.max_images = $slideshow.find('li').length
@changeSlide($slideshow)
changeSlide: (slideshow) ->
SlideShow.myInterval = setInterval ->
slideshow.find('li').hide()
if SlideShow.current_image < SlideShow.max_images
slideshow.find('li:eq(' + SlideShow.current_image + ')').fadeIn('slow')
SlideShow.current_image++
else
SlideShow.current_image = 0
slideshow.find('li:eq(' + SlideShow.current_image + ')').fadeIn('slow')
, 3500
$ ->
SlideShow.init()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment