- Posts: 4
- Thank you received: 0
Is it possible to pause slider onmouseover?
-
pedigopa
Inactive member - Topic Author
- New Member
Less
More
13 years 9 months ago #6039
by pedigopa
Is it possible to pause slider onmouseover? was created 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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
13 years 9 months ago #6044
by ivan.milic
Replied by ivan.milic on topic Re: Is it possible to pause slider onmouseover?
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.
/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
Less
More
- Posts: 4
- Thank you received: 0
13 years 9 months ago #6050
by pedigopa
Replied by pedigopa on topic Re: Is it possible to pause slider onmouseover?
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.
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.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
13 years 9 months ago #6061
by ivan.milic
Replied by ivan.milic on topic Re: Is it possible to pause slider onmouseover?
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.
-
Keith McBirnie
Inactive member - New Member
Less
More
- Posts: 2
- Thank you received: 0
12 years 7 months ago #18496
by Keith McBirnie
Replied by Keith McBirnie on topic Re: Is it possible to pause slider onmouseover?
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
Thanks
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
12 years 7 months ago #18508
by ivan.milic
Replied by ivan.milic on topic Re: Is it possible to pause slider onmouseover?
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