【发布时间】:2016-05-08 21:27:06
【问题描述】:
我的页面中有一个滑块,我想让动画在鼠标悬停时停止,然后在鼠标不再存在时恢复。
我用.stop 命令尝试了一些东西,但没能成功。
有人可以帮帮我吗?
var $item = $('.carousel .item');
var $wHeight = $(window).height();
$item.eq(0).addClass('active');
$item.height($wHeight);
$item.addClass('full-screen');
$('.carousel img').each(function() {
var $src = $(this).attr('src');
var $color = $(this).attr('data-color');
$(this).parent().css({
'background-image' : 'url(' + $src + ')',
'background-color' : $color
});
$(this).remove();
});
$(window).on('resize', function (){
$wHeight = $(window).height();
$item.height($wHeight);
});
$('.carousel').carousel({
interval: 2000,
pause: "false"
});
$(this).stop(true);
【问题讨论】:
-
你使用哪个
carousel?
标签: javascript jquery css