Is it possible to pause slider onmouseover? - HotThemes Forum - Hot Themes

Is it possible to pause slider onmouseover?

  • pedigopa
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
13 years 9 months ago #6039 by pedigopa
Is it possible to pause the image slider when mousing over the button and/or respective image?

Please Log in to join the conversation.

More
13 years 9 months ago #6044 by ivan.milic
Well it can be done but you would need to change script. That file is:
/modules/mod_hot_image_slider/js/scripts.js

Here is a hint.You can add some global variable at begging of that file like :

var MOUSE_IN = false;

then add handler functions when mouse enters and leaves slider:

jQuery('#slide-holder').mouseenter(function(){MOUSE_IN = true;});
jQuery('#slide-holder').mouseleave(function(){MOUSE_IN = false;});

Finally find this script and add some condition like this (marked red):

....
auto: function () {
if (!slider.ar) return false;
if (MOUSE_IN) return false;
var next = slider.cur + 1;
if (next >= slider.num) next = 0;
slider.slide(next);
},...

Note that this scripts I gave you may not work and may contain syntax mistakes because its only hint.
The following user(s) said Thank You: oneworld95, joomir

Please Log in to join the conversation.

  • pedigopa
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
13 years 9 months ago #6050 by pedigopa
Thanks for the response.

Okay, so what I need to do is create a variable called Mouse_In and set it to false.

Then I tell JQuery that when a user mouses over/out of the slide-holder div to toggle the new variables value.

Finally, I tell JQuery that if the variable is true to toggle it back to false.

Shouldn't the final IF statement also contain some control for stopping the animation? I'm sorry if this question seems stupid, I'm still learning Javascript and JQuery and I'm just not sure how the above example pauses the animation. I'll keep Googling.

Please Log in to join the conversation.

More
13 years 9 months ago #6061 by ivan.milic
The final line <if (MOUSE_IN) return false;> skips animation of next image if mouse is over the slider. return false; = abort further function execution in this case.

Please Log in to join the conversation.

More
12 years 7 months ago #18496 by Keith McBirnie
Hi, is it possible to post the code we would need to insert to pause the slider with a mouseover? Complete CSS coding ignorant here, apologies.

Thanks

Please Log in to join the conversation.

More
12 years 7 months ago #18508 by ivan.milic
It is described in post #6044, any further assistance would require you to pay for custom job.

Please Log in to join the conversation.

Time to create page: 0.169 seconds
Powered by Kunena Forum