Monday, 7 April 2014

How to stop jquery imageslider on mouse hover 0

Jake Rocheleau designed a very nice jQuery image rotators with description  plug-in.

He missed to instruct how to stop this animation. Here I got the STACKOVERFLOW post. And answered to that question.

Question: How to stop jquery imageslider on mouse hover.

Simply we need to find the correct selector. And .clearInterval() on .mouseover() event listener. Then reset the slide time in setInterval() in .mouseout() event listener.

like this below code,

$('.image_thumb ul li').on("mouseover",function(){
  clearInterval(intervalID);
});

$('.image_thumb ul li').on("mouseout",function(){
  intervalID = setInterval(cycleImage, slidetime);
});

 Here is my STACKOVERFLOW answer post.


0 comments:

Post a Comment