以下是原本的代码:
<html>
<head>
<script type=”text/javascript” src=”jquery-1.4.2.min.js”></script>
<script type=”text/javascript”>
$(document).ready(function(){
$(window).resize(function(){
$(“#imgId”).height($(window).height());
$(“#imgId”).width($(window).width());
});
});
</script>
</head>
<body>
<table>
<tr>
<td>
<img id=”imgId” src=” http://rescdn.qqmail.com/dyimg/20120823/70A650D019B8.jpg “>
</td>
</tr>
</table>
</body>
</html>
在测试的时候,当浏览器全屏和缩小时,图片不会根据页面来自动调节,浏览器放大缩小后的效果,明显是不一样的,该如何来解决这个问题呢?
经过查阅资料和试验多次,有3种方法可以解决这个问题,详细方法,请参阅如何实现图片的自动缩放
此文转载自:K.N.J's blog
更多信息: