こんにちは私はJqueryFlipプラグインを使用しています-http: //lab.smashup.it/flip/
ホバー時にフリップを実行するこのコードがあります。マウス入力すると、「。container」が裏側にあります。マウスを離れると、「。container」が前面に表示されます。
mouseenterフリップアニメーションが終了する前にマウスが「.container」を離れると、「。container」は前面に戻りません。これが起こったら、フリップを止める必要があります。どうすればこれを達成できますか?'stop(true、false)'のように使用するのでしょうか、それとも'if($(this).is( ":animated")){}...'または'var hovering = 0; $( "。container")。hover(function(){hovering = 1;}、function(){hovering = 0;}); .. etc '
助けてください。ありがとう。
$('.container').bind("mouseenter", function() {
var elem = $(this);
if (elem.data('flipped')) {} else {
elem.flip({
direction: 'lr',
speed: 500,
onBefore: function() {
elem.html(elem.siblings('.content').html());
},
onAnimation: function() {
elem.data('flipped', true);
},
onEnd: function() {}
});
}
});
$('.container').bind("mouseleave", function() {
var elem = $(this);
if (elem.data('flipped')) {
elem.flip({
direction: 'rl',
speed: 500,
onBefore: function() {
elem.html(elem.siblings('.initContent ').html());
},
onAnimation: function() {
elem.data('flipped', false);
},
onEnd: function() {}
});
}
});