0

I'm trying to code a play/pause button via Jquery and the Cycle plugin. I'm able to toggle between the two and the "resume" function works, but am not sure how to make the "pause" function work. Any ideas?
Thanks in advance for your time!

Here's my JS:

<script type="text/javascript">
      $(document).ready(function() {
$('#toggle').bind("click", function() {
if ($(this).attr("class") == "pauseButton")

$(this).attr("class", "resumeButton");

else

$(this).attr("class", "pauseButton");
        });
      });
    </script>

Here's my HTML:

    <div id="toggle" class="resumeButton"></div>

Edited by Nick Evan: Fixed formatting

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by amko
0

Also, one more bit of code that might be helpful... here's the JS where I'm initializing the play/pause function in the code before the toggle:

$('.pauseButton').click(function() {
    $slideshow.pause();
});

// attach resume functionality to resume button
$('.resumeButton').click(function() {
    $slideshow.resume(true);
});

Edited by mike_2000_17: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.