Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Slideshow Pause button fail

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #278453
    gardengirl153
    Participant

    I cannot for the life of me find out why my slideshow fails as soon as I try to add a pause button.
    I am sure its something obvious and simple but I have stared at it for hours and tried forums, copying other codes, nothing. At this point the clearTimout function is not working at all, and when i press “play” it actually speeds up the timer somehow.
    https://codepen.io/aliciaguitar/pen/xQxNRd

    #278454
    gardengirl153
    Participant

    nevermind I figured it out finally. i had to declare my var earlier and add an if else statement in a function

    #278458
    muratkezli
    Participant

    Firstly write a new function

    function stopSlide(){
    clearTimeout(showSlides);
    showSlides = null;
    }

    then call button onclick like onclick=”stopSlide()”

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.