我想做一个可以拉伸的div 就是鼠标移动到div边框时鼠标的形状变成左右或者上下箭头 并且按下鼠标时可以拉伸div的大小 小弟搞了几天 头昏脑胀 可否给一段代码

解决方案 »

  1.   

    代码
    http://www.twinhelix.com/javascript/dragresize/demo/
      

  2.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>MS_resizeDiv.html</title>

        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="this is my page">
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <script>   
         document.execCommand("2D-position", false, true);   
    </script>   
      </head>
      
      <body>
        <DIV contentEditable=true>   
    <DIV style="WIDTH: 300px; POSITION: absolute; HEIGHT: 100px; BACKGROUND-COLOR: red">移动层</DIV>   
    </DIV>
      </body>
    </html>jquery的插件jqmodel可以拖动大小,也很不错哦