我正在为 picbox.us 网站制作一个画廊,当我将鼠标悬停在图像上时,我变得迟钝。它应该只是将我的图像信息的高度设置为 40,仅此而已。但有时它会滞后或延迟。这是页面:http: //zachrip.net/widgets/gallery/
这是与该问题有关的唯一代码:
查询:
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".image").hover(
function () {
$("#" + this.id + "info").animate({height: '40'}, 700);
}
);
$(body).hover(
function(){
$(".imageinfo").animate({height: '0'}, 700);
}
);
$("#container").hover(
function(){
$(".imageinfo").animate({height: '0'}, 700);
}
);
});
</script>
html:
<div id='container'>
<center>
<p>Beta testing image gallery</p>
<table cellpadding="1" cellspacing="5">
<tr>
<td><center><img class="image" id="1" src="img1.png"/></center><p id="1info" class="imageinfo">Uploaded by muny</p></td>
<td><center><img class="image" id="2" src="img1.png"/></center><p id="2info" class="imageinfo">Uploaded by zachrip</p></td>
<td><center><img class="image" id="3" src="img1.png"/></center><p id="3info" class="imageinfo">Uploaded by seanrice</p></td>
</tr>
<tr>
</table>
</center>
</div>