鼠标悬停时显示无失真的大图像此外,图像来自使用php的数据库,所以我的问题是是否有任何简单的方法在jquery css javascript等中,这将是最简单的谢谢
这是从数据库显示图像的代码
<div>
<table>
<tr>
<td>
?php
$query = "SELECT * from images";
$result = mysql_query($query);
while($fetch = mysql_fetch_array($result)) {
echo "<img src="http://localhost/images_path/{$fetch['image']}" width="15%" height="135px">"."  ";
}
?>
</td>
</tr>
</table>
</div>
你可以用一个简单的css来完成。。
div.img img { height: 90px; width: 110px; }
div.img img:hover { height: auto; width: auto; }
另一种方法可能是
function mouseOver()
{
var img1 = document.getElementById("img1");
img1.src ="images/p2.jpg";
img1.width = "";
img1.height = "";
}
function mouseOut()
{
var img1 = document.getElementById("img1");
img1.src ="images/p1.jpg";
img1.width = "90";
img1.height = "110";
}
还可以看看这个JSFIDDLE演示