• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

[JQUERY] jCarouselLite: Pause Scrolling on hover

bigtail

New member
I'm using jCarouselLite and everythig is working fine.
However I want that the auto scrolling paused once I hover over the carousel.

The jCarouselLite doco is saying that I can use this:

$('div.carousel').trigger('pauseCarousel')

But I don't understand much about jQuery. How can I implement that pause function in the following code?:

HTML:
   <script>
    jQuery(function() {	
        jQuery(".carousel").jCarouselLite({
    	    auto: 3000,
		    speed: 1000,
		    visible: 1,
		    circular: true,
            autoWidth: true,
		    responsive: true,
		    vertical: true
       });
    });
    </script>
Thanks
 
Zuletzt bearbeitet von einem Moderator:
Try this:
Code:
jQuery('div.carousel').hover(function(){jQuery(this).trigger('pauseCarousel');},
                             function() {jQuery(this).trigger('resumeCarousel');});
PS: The "pause" option should have the same effect.
 
Zuletzt bearbeitet:
Thanks for your reply.

I used this:

HTML:
<script>
jQuery(function() {
    jQuery(".carousel").jCarouselLite({
    	auto: 3000,
		speed: 1000,
		visible: 1,
		circular: true,
        autoWidth: true,
		responsive: true,
		vertical: true
		});
		
		jQuery('.carousel').hover(function() {
			jQuery(this).trigger('pauseCarousel');
			});
		   
});
</script>
which didn't work.
 
Zuletzt bearbeitet von einem Moderator:
You have to pass two parameters/functions to hover(), one for action at mousenter and the other one for mouseleave:
Code:
jQuery('div.carousel').hover(function() {jQuery(this).trigger('pauseCarousel');},
                             function() {jQuery(this).trigger('resumeCarousel');});
Please read the PS in my previous posting: Using the "pause" option would be much easier.
PS: A semicolon was in the wrong place. I have corrected this.
 
Zuletzt bearbeitet:
Zurück
Oben