js zoom放大缩小问题

laxxx6 2009-07-21 11:17:54
我用了body.style.zoom来放大或缩小我的页面,但之后,很多东西出了问题,如拖动div事件,不知道放大或缩小之后 对象的象素有没有变化,如果拖动,拖动的距离是不是也变小或是变大了,如果返回原状态还得把距离放大或缩小...请教各位大侠了.....
...全文
1081 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
laxxx6 2009-07-21
  • 打赏
  • 举报
回复
我正在试,放大或缩小后,我的拖动div的距离是不是也放大或是变小了,好像很多值都要跟着变大变小....正在测试中.
shenzhenNBA 2009-07-21
  • 打赏
  • 举报
回复
试看下面的例子。。。


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript" type="text/javascript">
function chanZoom(x)
{
document.body.style.zoom=x+"%";
}
</script>

<body>
<table width="100%" border="3">
<tr>
<td> </td>
<td bgcolor="#99CC00"> </td>
</tr>
<tr>
<td bgcolor="#990000"> </td>
<td> </td>
</tr>
</table>
<p><img src="http://avatar.profile.csdn.net/5/5/C/2_laxxx6.jpg" width="100" height="100"></p>
<p>
<input type="button" name="Submit" value="放大为320%" onClick="javascript:chanZoom(320);">
 
<input type="button" name="Submit" value="缩小为50%" onClick="javascript:chanZoom(50);">
</p>
</body>
</html>
shenzhenNBA 2009-07-21
  • 打赏
  • 举报
回复
对于图片进行修改style.zoom放大时像素会边粗糙,对body的情况类似的,所有对象的像素都回放大或缩小,至少IE6。0下是这样