下面是我的代码:
'$(".hoverfront").mouseenter(function () {'
var elem = $(this);
elem.flip({
direction: 'lr',
color: 'red',
speed: 700,
content: $(".description"),
onBefore: function(){
$(this).removeClass('hoverfront');
$(this).addClass('back');
}
});
}).mouseleave(function () {
$(".back").revertFlip();
});http://jsfiddle.net/mornaistar/eHfUa/
我的点击事件工作得很好,但是我的鼠标悬停事件弄乱了我的大脑,我做错了什么?
发布于 2013-01-12 14:54:37
更新了你的代码。请参阅JSFiddle demo here
var isHover = false;
$(".hoverfront").mouseenter(function () {
if (isHover == false) {
isHover = true;
var elem = $(this);
elem.flip({
direction: 'lr',
color: 'red',
speed: 700,
content: $(".description"),
onBefore: function () {
elem.removeClass('hoverfront');
elem.addClass('back');
}
});
}
}).mouseleave(function () {
var $this = $(this);
$this.revertFlip();
$this.removeClass('back');
$this.addClass('hoverfront');
isHover = false;
});问题是
在revertFlip
https://stackoverflow.com/questions/14290804
复制相似问题