Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9096473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:51:43+00:00 2026-06-16T23:51:43+00:00

I have a rotating slider on a website that I am working on. the

  • 0

I have a rotating slider on a website that I am working on.

the slider automatically scrolls when the page is loaded, and is supposed to stop when it is moused over, and then start again when the mouse leaves.

I have the stopping of the slider working, but when i mouse out, the slider starts up again, but twice as fast, causing the slider to show no content.

Is there some reason why my clear interval is not working correctly? how can i get the slider to stop and start without it changing speed and messing up?

     rotateSwitch: function() {  
       var myTimer=setInterval(function() { this.autoRotate(); }.bind(this), 5000);
       $('.hero img').hover(
         function() {
         window.clearInterval(myTimer)},
         function() {
         this.rotateSwitch();}.bind(this));
    },       
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:51:44+00:00Added an answer on June 16, 2026 at 11:51 pm

    On every mouseleave you bind the function again by calling this.rotateSwitch(). Instead, only start the interval again:

    rotateSwitch: function() {  
        var myTimer,
            that = this;
        function start() {
            myTimer = setInterval(that.autoRotate.bind(that), 5000);
        }
        function stop() {
            clearInterval(myTimer);
        }
        $('.hero img').hover(stop, start);
        start();
    },
    

    If that function is called multiple times, you might want to restrict your .hero img selector to a specific context as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apparently, the demo page on the http://twitter.github.com/bootstrap/javascript.html#carousel seems to have carousel stop rotating after
I have a rotating slide show I'm working on that uses Javascript. I use
I have a problem with rotating. I know that I can rotate a Texture2D
Programming language: Java Ok, so I want to have a BufferedImage that keeps rotating
I have an MKMapView that I am considering rotating in order to more conveniently
I have a view (InfoVC) that is rotating even if I set shouldAutoRotate to
I have one problem regarding rotating the <div> in html page. I have used
I have an ImageManipulator class that performs some cropping, resizing and rotating of camera
I have a few rotating videos on a home page. The first video shows
I have an html table that needs rotating / axis swaping. It can be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.