Reputation: 375
I have a running code that works only when I mouse hover on it and it stops when I take the mouse out of it. but my requirement is when I make a mouse out the images should set to default i.e first image should be set.
<div class="cycle-slideshow">
<img src="http://malsup.github.io/images/p1.jpg" class="cycle-carousel-wrap">
<img src="http://malsup.github.io/images/p2.jpg" class="cycle-carousel-wrap">
<img src="http://malsup.github.io/images/p3.jpg" class="cycle-carousel-wrap">
<img src="http://malsup.github.io/images/p4.jpg" class="cycle-carousel-wrap">
</div>
<script>
$(document).ready(function() {
function buildCycle() {
$('.cycle-slideshow').cycle({
timeout: 500,
delay: 1,
speed: 1
})
}
$('.cycle-slideshow').cycle("pause").hover(function() {
$(this).cycle('resume');
}, function() {
$(this).cycle('pause');
});
});
</script>
How can I make it work?
Upvotes: 1
Views: 61