2012-03-29 22 views
0

jqueryで少しのマウスオーバーエフェクトを実装しようとしていますが、ちらつきの問題を解決できません。私はすでに、マウスオーバーの遅延を挿入しようとしましたが、まだ私は画像に問題があります。マウスオーバーでちらつきを避ける

誰かがこれについて手掛かりを持っていますか?

敬具、サシャ

テストURL:www.de-facto-magazin.de

$(".item").hover(

function() { 
    $(this).parent().parent().find(".title").show(); 
    $(this).parent().parent().find(".bg").show(); 
    $(this).parent().parent().find(".bg").addClass("transparent"); 
    $(this).find(".bg").removeClass("transparent"); 
    $(this).find(".title").addClass("colored"); 
}, function() { 
    $(this).parent().parent().find(".title").hide(); 
    $(this).parent().parent().find(".bg").hide(); 
    $(this).parent().parent().find(".title").removeClass("colored"); 

})​ 
+0

画像間の隙間にマウスオーバーが発生すると点滅します。 – Straseus

+0

代わりに、ホバーハンドラを代わりに#splashに配置します。それはうまくいくはずです。 – Straseus

+0

私はそのようなイベントのためにいくつかのタイムアウトを使用し、fadeInとfadeOutイベントを使用しようとしました –

答えて

1

ちらつきを回避する最善の方法は、処理するために、外側のdivの上の別のホバーイベント(ID =「スプラッシュ」)を持つことです表示/非表示にして、現在のイベントのみを使用して、どのdivがアクティブであるかを処理します。これらの行に何かがあります(警告、コード未テスト)。

$("#splash").hover(
    function(){ 
     $(this).find(".title").show(); 
     $(this).find(".bg").show(); 
    },function(){ 
     $(this).find(".title").hide(); 
     $(this).find(".bg").hide(); 
    } 
); 

$(".item").hover(
    function(){ 
     $(this).parent().parent().find(".bg").addClass("transparent"); 
     $(this).find(".bg").removeClass("transparent"); 
     $(this).find(".title").addClass("colored"); 
    } 
); 
+0

クイックサポートのためのThx、 "スプラッシュ"に別々のホバーを持つヒント-divはそれを行いました。 – bipulse

+0

うれしい私は助けることができます。今後のGoogle社員のために正しい答えを記入することを忘れないでください。スタックオーバーフローへようこそ! –

関連する問題