<object   id=hh1   classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">   
<param   name="Command"   value="Minimize"></object>
<object   id=hh2   classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">   
<param   name="Command"   value="Maximize"></object>
<OBJECT   id=hh3   classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM   NAME="Command"   VALUE="Close"></OBJECT><input   type=button   value=最小化   onclick=hh1.Click()>
<input   type=button   value=最大化   onclick=hh2.Click()>
<input   type=button   value=关闭   onclick=hh3.Click()>

解决方案 »

  1.   

    关注,
    不过楼主期待的不是
    hbhbhbhbhb1021(天外水火(我要多努力)) 
    这种最小化
      

  2.   

    <html>
    可以仿“最小化”,
    可用“hbhbhbhbhb1021(天外水火(我要多努力)) ”做实际的最小化,自己选择
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    <script language=javascript>
    function min()
    {
    window.resizeTo(50,20);
    window.moveTo(0,window.screen.availHeight-30);
    }
    </script>
    </head><body>
    <div id="xMsg" style="left:20px;top:20px;z-index:99;position:absolute;width:300px;height:220px;" onclick="javascript: min();">
    divdiv</div>
    </body>
    </html>
      

  3.   

    呵呵,先谢谢楼上两位了,可能是我没说清楚吧,hbhbhbhbhb1021和Jackkd() 写的都是整个浏览器窗口最小化操作。我的意思是“如何让我现在的这个xMsg层双击后自动最小化到当前xMsg所在页面的左下角。”
      

  4.   

    这是我现在写的一个页面:
    http://www.91do.net/leon/Js_02.htm现在就是想实现“最小化”的功能,大家帮忙看看,^_^。至于FF下的兼容问题,下次开帖再请教。
      

  5.   

    改下
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>mobile layer</title>
    <style type="text/css">
    body{
    font:11px Verdana;
    background-color:slategray;
    text-align:center;
    }
    #xMsg{
    border:#fff 1px solid;
    cursor:hand;
    }
    .xOp{
    font:10px webdings;
    color:white;
    border:0px;
    width:12px
    }
    </style>
    <script language="javascript" type="text/javascript">
    var _x0 = 0
    var _y0 = 0
    var _x1 = 0
    var _y1 = 0;//var _offx = 6
    //var _offy = 6;var moveable=false;function startDrag(obj)
    {
      if(event.button == 1)
      {
        var win=obj.parentNode;
        //get focus;
        obj.setCapture();
        
        //get the position of mouse
        _x0 = event.clientX;
        _y0 = event.clientY;
        //get the position of layer
        _x1 = parseInt(win.style.left);
        _y1 = parseInt(win.style.top);
        
        moveable = true;
      }
    }function doDrag(obj)
    {
      if(moveable)
      {
        var win = obj.parentNode;
        win.style.left = _x1 + event.clientX - _x0;
        win.style.top = _y1 + event.clientY - _y0;
      }
    }function stopDrag(obj)
    {
      if(moveable)
      { 
        var win = obj.parentNode;
        obj.releaseCapture();
        moveable = false;
      }
    }function minWin(obj)
    {
      //get the layer whose id is xMsg
      var win = obj.parentNode.parentNode;
      //get it's parent element(layer too!)
      var tit = obj.parentNode;
      //get another layer which is near its parent element
      var msg = tit.nextSibling;
      //define the layer's original state
      var flag = msg.style.display == "none";
      if(flag)
      {
        win.style.height = parseInt(msg.style.height) + parseInt(tit.style.height) + 1 * 2;
        msg.style.display = "block";
        win.style.top=Top;
        win.style.left=Left;
        obj.innerHTML = "0";
      }
      else
      {
        win.style.height = parseInt(tit.style.height) + 1 * 2;
        Top=win.style.top;
        Left=win.style.left;
        win.style.top=document.documentElement.scrollTop+ document.documentElement.scrollHeight-25
        win.style.left=0;
        msg.style.display = "none";
        obj.innerHTML = "2";
      }
    }function closeWin(obj)
    {
      var win = obj.parentNode.parentNode;
      win.style.display = "none";
    }</script>
    </head><body>
    <div id="xMsg" style="left:20px;top:20px;z-index:99;position:absolute;width:300px;height:220px;">
    <!-- div -->
    <div id="xMsg_sub" style="border:0px;height:16px" onmousedown="startDrag(this)" onmouseup="stopDrag(this)" onmousemove="doDrag(this)" >
    <span style="border:0px;width:270px" ondblclick="minWin(this.nextSibling)"></span><span class="xOp" onclick="minWin(this)">0</span><span class="xOp" onclick="closeWin(this)">r</span>
    </div>
    <div style="border-top:#fff 1px solid;background-color:#eee;height:200px">
    this is a test!
    <p>designed by leon in Mar 2006
    </div>
    <!-- div -->
    </div></body>
    </html>
      

  6.   

    Top=win.style.top;
    Left=win.style.left;
    win.style.top=document.documentElement.scrollTop+ document.documentElement.scrollHeight-25^_^,就是这个地方documentElement没写清楚,呵呵,hbhbhbhbhb1021兄能不能再解释一下 ^_^
      

  7.   

    在隐藏的时候把显示的层的top和left分别为浏览器滚动条滚进去的高度加上浏览器本身的高度和0,这样就是左下角了,在把原层的上边框的位置和左边框的位置赋给Top和Left两个变量,等最大化的时候在变回来