0
我已經問了一些關於這個問題的問題,我做了一些修改,用戶在這裏建議,但我仍然無法解決問題。我很少知道JavaScript,我只是修改了另一個頁面的代碼。jQuery兼容性問題與Internet Explorer 7和一般buggy行爲
我有這個代碼,當鼠標懸停在圖像上時,它動態地將Div圖像放在圖像上。你可以在這個測試頁查看:cine.uuuq.com
-In Firefox works perfect。
- 在Chrome中,我收到了一些錯誤行爲。當鼠標靠近div底部時,div向上滑動。
- 在Internet Explorer 7中,一切運行速度非常慢(buggy),而且div定位不當。
jQuery的:
jQuery.fn.masque = function(classSelector) {
$(this).hover(function(){
$(this).find(classSelector).stop().animate({height:'90px',opacity: '1'},400);
},function() {
$(this).find(classSelector).stop().animate({height:'0',opacity: '0'}, 300);
});
};
$(document).ready(function(){$('.thumb').masque('.masque');});
的HTML:
<div class="thumb bg25">
<a href="#"><img src="img/poster2.jpg" alt="Movie Title" /></a>
<div class="masque">
<h3 class="movietitle"><a href="#" >Movie Title</a></h3>
<p class="movieinfo">2008</p>
<p class="movieinfo">Drama, History, Comedy, Short</p>
</div>
</div>
的CSS:
.thumb {float:left; margin:0 14px 14px 0; width:126px; height:186px; padding:10px; position:relative;}
.masque {position:absolute; background:#212326; width:118px; bottom:10px; height:0; padding:4px; display:none;}
也許有人可以幫我解決這些兼容性問題!謝謝!
就像我說的我大多複製此代碼,並修改它,所以我真的不明白jQuery和這將是莫重建的代碼非常困難... 。 不管怎麼說,還是要謝謝你! – Jonathan 2009-02-09 15:44:59