你知道为什么
$('.filmstrip').mouseenter(function(){
var isStopped = false;
var $that = $(this),
w = $that.width(),
fr = $that.attr('data-framerate');
$that.css('background-position-x',$that.attr('data-placeholderXStart'));
$that.css('background-image','url('+$that.attr('data-gifurl')+')');
for ( var i = 1, n = $that.attr('data-ticks'); i <= n && !isStopped; ++i )
{
(function(j){
setTimeout(function(){
if (!isStopped) {
$that.css('background-position-x','-'+(w*j)+'px');
}
}, j*fr);
})(i);
}
$that.bind('mouseleave',function(){
isStopped = true;
$that.css('background-image','url('+$that.attr('data-placeholder')+')').css('background-position-x',$that.attr('data-placeholderXStart'));
});
});
正在开发Chrome和IE但不支持FF吗?我在那里放了一个console.log
而mouseenter
事件没有调用。我已尝试将活动更改为mouseover
和hover
,但仍然没有运气。