Stop and play owl carousel on click Jquery !

nstplanet web creation and solution services

How to stop and play owl carousel on click.. so here is the custom script that help you to work owl carousel as per your need.

If your owl carousel is on autoplay mode then..

// Pause on click item image
jQuery('body').on('click','.owl-carousel .item img',function(){
jQuery('.owl-carousel').trigger('stop.owl.autoplay');
var carousel = jQuery('.owl-carousel').data('owl.carousel');
carousel.settings.autoplay = false;
carousel.options.autoplay = false;
jQuery('.owl-carousel').trigger('refresh.owl.carousel');
});

After Pause the carousel if you want to play that again then..

// Replay on click close
jQuery('body').on('click','.vidpop', function(){
jQuery('.owl-carousel').trigger('play.owl.autoplay');
var carousel = jQuery('.owl-carousel').data('owl.carousel');
carousel.settings.autoplay = true;
carousel.options.autoplay = true;
jQuery('.owl-carousel').trigger('refresh.owl.carousel');
});

Note :  Please Contact with me if you are still in confusion.

I hope this help you thanks .. 🙂

If this help you then.. Can you buy a Cup of Coffee for me by nst webcreation paypal--OR-- nst webcreation blog coffee cup

Published by

NST

Myself Narender Singh Thakur ( NST ) and i share my Experience/Knowledge and Tricks for folks and beginners to solve their issues while making websites through this Planet.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Click to Chat