我用了body.style.zoom来放大或缩小我的页面,但之后,很多东西出了问题,如拖动div事件,不知道放大或缩小之后 对象的象素有没有变化,如果拖动,拖动的距离是不是也变小或是变大了,如果返回原状态还得把距离放大或缩小...请教各位大侠了.....

解决方案 »

  1.   

    对于图片进行修改style.zoom放大时像素会边粗糙,对body的情况类似的,所有对象的像素都回放大或缩小,至少IE6。0下是这样
      

  2.   

    试看下面的例子
    <!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>&nbsp;</td>
        <td bgcolor="#99CC00">&nbsp;</td>
      </tr>
      <tr>
        <td bgcolor="#990000">&nbsp;</td>
        <td>&nbsp;</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);">
      &nbsp;
      <input type="button" name="Submit" value="缩小为50%" onClick="javascript:chanZoom(50);">
    </p>
    </body>
    </html>
      

  3.   

    我正在试,放大或缩小后,我的拖动div的距离是不是也放大或是变小了,好像很多值都要跟着变大变小....正在测试中.