2009-02-09 61 views
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;} 

也許有人可以幫我解決這些兼容性問題!謝謝!

回答

1

如果我帶你在問題中所引用的代碼,並把它變成一個測試頁面它工作正常,我在IE7,雖然你掛肯定是推動東西在IE7正確的測試頁。

我建議你從你的問題採取了代碼和行重建試驗場線的效果,直到你打破它。這應該是哪裏出了問題一個非常公平的指示:)

+0

就像我說的我大多複製此代碼,並修改它,所以我真的不明白jQuery和這將是莫重建的代碼非常困難... 。 不管怎麼說,還是要謝謝你! – Jonathan 2009-02-09 15:44:59