Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 deletions source/jquery.slides.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@
play:
# Play and stop button setting.
active: false
# [boolean] Create the play and stop buttons.
# You cannot use your own pagination.
# [boolean] Enable hands-free playing of slideshow.
generate: true
# [boolean] Create play and stop button.
# You can set to false and use your own play/stop buttons.
# User defined play/stop buttons must have the following:
# play: class="slidesjs-play slidesjs-navigation"
# stop: class="slidesjs-stop slidesjs-navigation"
effect: "slide"
# [string] Can be either "slide" or "fade".
interval: 5000
Expand Down Expand Up @@ -204,19 +209,29 @@
@previous(@options.navigation.effect)

if @options.play.active
playButton = $("<a>",
class: "slidesjs-play slidesjs-navigation"
href: "#"
title: "Play"
text: "Play"
).appendTo($element)

stopButton = $("<a>",
class: "slidesjs-stop slidesjs-navigation"
href: "#"
title: "Stop"
text: "Stop"
).appendTo($element)
# If slideshow active

if @options.play.generate
# Generate play / stop button
playButton = $("<a>",
class: "slidesjs-play slidesjs-navigation"
href: "#"
title: "Play"
text: "Play"
).appendTo($element)

stopButton = $("<a>",
class: "slidesjs-stop slidesjs-navigation"
href: "#"
title: "Stop"
text: "Stop"
).appendTo($element)

else
# Search for user's play/stop buttons
playButton = $(".slidesjs-play.slidesjs-navigation", $element)
stopButton = $(".slidesjs-stop.slidesjs-navigation", $element)


playButton.click (e) =>
e.preventDefault()
Expand Down