0
大家都希望有人能幫助我。jquery懸停在圖像上導致嵌套div閃爍和鼠標
我在頁面上有一系列照片,當您將鼠標懸停在它們上面時,淡化了白色的效果,並在其上顯示標題和說明。
我遇到的問題是,如果我將鼠標懸停在文本區域上,那麼白色的效果會再次消失。這是一個奇怪的閃爍問題。
我需要它的工作,以便無論你在圖像上懸停的位置,它總是保持着色,然而當它關閉時,它會回到正常圖像。
我想學習編碼,所以裸露在我身邊。我在其他帖子中發現了類似的問題,但無法計算出他們的建議如何應用於我的代碼。
我的代碼如下。
$('div.project-image a img').mouseover(function() {
$('div.hover').css('filter', 'alpha(opacity=70)');
$('div.hover', $(this).parent().parent()).fadeIn(500);
});
$('div.hover').mouseout(function() {
$('div.hover').css('filter', 'alpha(opacity=70)');
$('div.hover', $(this).parent().parent()).fadeOut(500);
});
$('div.hover').bind('click', function(e) {
window.location = $(this).parent().children('a').attr('href');
});
使用的CSS樣式:
#content div.project-image (styles the image area)
#content div.hover (displays the white tinted image)
#content div.hover h1 (styles the title)
#content div.hover p (styles the description)
http://www.jsfiddle.net/上傳足以重現問題 – 2011-12-16 00:36:39
我沒有嘗試這樣做,需要的代碼,但我無法得到它的工作。代碼遍佈wordpress主題的不同位。 – Glyph 2011-12-16 01:23:12