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