Problem with an image slider.
Hey guys,
I made up this image slider:
-
<script>
$(document).ready(function() {
$(".slider #1").fadeIn(500);
$(".slider #1").delay(5500).fadeOut(500);
var sc = $(".slider img").size();
var count = 2;
var intervalVal = setInterval(function() {
$(".slider #"+count).fadeIn(500);
$(".slider #"+count).delay(5500).fadeOut(500);
if (count == sc) {
count = 1;
} else {
count = count + 1;
}
}, 6500);
});
</script>
It works great, there is only one thing I would like to change.
I would like to add a .hover(function(){}); which stops the "animation". But it should not be like clearing the interval, because than the last picture will just fade out and the slider is empty.
Means:
hover = no fading ; like delay(as long as hovering).
If you go away with your cursor, the slider should start where it stopped.
Best Regards ;)