The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Anything Slider stopping autoPlay

  • # March 9, 2011 at 10:57 pm

    Inside my anything slider, I have links that open up lightbox. The problem with the way anything slider is set up is that when I click the link inside the slider, the lightbox opens up with the content but the anything slider keeps on looping in the background. How can I stop the slider when a user clicks on a link inside of it?

    # March 9, 2011 at 11:47 pm

    This reply has been reported for inappropriate content.

    Hi Thedark_master!

    Before you open the lightbox, just add this bit of script to stop the slide show. Make sure your slider is targeted, I’m using “#mySlider” in the example.

    $('#mySlider').data('AnythingSlider').startStop(); // this stops the slideshow
    # April 5, 2011 at 9:24 am

    I apologize for the late reply, I was waiting for an email to be sent when someone replied to my question. So I am not that familiar with how to link javascript code to my link inside the document. Can you help me out with this? So for example if my code for the link is this:

    How would I link the JS code you gave me?

    # April 5, 2011 at 1:41 pm

    This reply has been reported for inappropriate content.

    Add this code somewhere on your page. Just make sure the slider ID matches:

    $('#mySlider').data('AnythingSlider').startStop(); // this stops the slideshow
    # April 5, 2011 at 4:10 pm

    thank you so much!

    # November 30, 2012 at 9:51 am

    My anything slider is placed in a div id=”main”. I have the function below set to stop the slide when click are done in main.. The slider does not pause and keeps playing.


    $(‘#slider1’).data(‘AnythingSlider’).startStop(); //stop the slideshow

    supposed to stop the slide.. I am I missing something? Please Help.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed