Closed shenzhenboy closed 9 years ago
I don't see any initialization of the autoscroll plugin in your code. And please, can you extract the releveant parts into a working jsfiddle.
Sorry.
.jcarousel({wrap:"circular", animation: {'easing': 'linear', 'duration': 3000} })
.jcarouselAutoscroll({'autostart': true, 'interval': 0});
How do i make my autoscroll stop and start when mouse cursor is on and off?
Just use something like
jcarousel.hover(
function() {
jcarousel.jcarouselAutoscroll('stop');
},
function() {
jcarousel.jcarouselAutoscroll('start');
},
);
where should i input the command?
jQuery(document).ready(function($) { var start_mobile_size = 960;
if($('body').hasClass('isphone')) { var isphone = true; }
if ( $.isFunction($.fn.jcarousel) ) {
var jcarousel = $('.slider');
jcarousel.on('jcarousel:reload jcarousel:create', function () {
var jcarouselwidth = jcarousel.innerWidth();
if (jcarouselwidth >= 1200) {
jcarouselwidth = jcarouselwidth / 6;
} else if (jcarouselwidth >= 800) {
jcarouselwidth = jcarouselwidth / 5;
} else if (jcarouselwidth >= 700) {
jcarouselwidth = jcarouselwidth / 4;
} else if (jcarouselwidth >= 500) {
jcarouselwidth = jcarouselwidth / 3;
} else if (jcarouselwidth >= 350) {
jcarouselwidth = jcarouselwidth / 2;
}
jcarousel.jcarousel('items').css('width', jcarouselwidth + 'px');
})
.jcarousel({wrap:"circular", animation: {'easing': 'linear', 'duration': 3000} })
.jcarouselAutoscroll({'autostart': true, 'interval': 0});
}//if function jcarousel
Put it somewhere after
var jcarousel = $('.slider');
How do i edit this command to make my slider autoscroll and stop once mouse cursor hove over?
Thanks.
jQuery(document).ready(function($) { var start_mobile_size = 960;
});
function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0; i<ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("=")); y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } }