<script language=javascript>cv=0</script>
<body topmargin=0 leftmargin=0 scroll=no>
<table cellpadding=0 cellspacing=0 width=100%>
 <tr  height=20 >
    <td align=center onmousedown='cv=1;x=event.x;y=event.y;setCapture();' onmouseup='cv=0;releaseCapture();' onmousemove='if(cv)window.moveTo(screenLeft+event.x-x,screenTop+event.y-y);'>拖动</td>
 </tr>
</table>

解决方案 »

  1.   

    窗口往下跳是因为moveTo改变了窗口的位置。
      

  2.   

    放心了,没有标题栏就不会跳到标题栏上了:)
    给你你说的那个效果的全部代码:
    版权所有:钟钟@www.iecn.net
    <script language=javascript>
    minimizebar="51js/img/mini.gif"; //nbw窗口右上角最小化“按钮”的图片
    closebar="51js/img/close.gif";       //nbw窗口右上角关闭“按钮”的图片
    icon="51js/img/n.gif";            //nbw窗口左上角的小图标
    function noBorderWin(fileName,w,h,titleBg,titleColor,titleWord,borderColor,scr)
    /*
    ------------------参数说明-------------------
    fileName   :无边窗口中显示的文件。
    w       :窗口的宽度。
    h       :窗口的高度。
    titleBg    :窗口“标题栏”的背景色。
    titleColor :窗口“标题栏”文字的颜色。
    titleWord  :窗口“标题栏”的文字。
    borderColor:窗口“边框”的颜色。
    scr        :是否出现滚动条。取值yes/no或者1/0。
    --------------------------------------------
    */
    { nbw=window.open('','','fullscreen=yes');
      nbw.resizeTo(w,h);
      nbw.moveTo((screen.width-w)/2,(screen.height-h)/2);
      info="<title>"+titleWord+"</title>"+"<"+"script language=javascript"+">"+"cv=0"+"<"+"/script"+">"+
    "<body topmargin=0 leftmargin=0 scroll=no>"+"<table cellpadding=0 cellspacing=0 width=100% height=100% style=\"border: 1px solid "+borderColor+"\">"+
    "  <tr bgcolor="+titleBg+" height=20 onselectstart='return false' onmousedown='cv=1;x=event.x;y=event.y;setCapture();' onmouseup='cv=0;releaseCapture();' onmousemove='if(cv)window.moveTo(screenLeft+event.x-x,screenTop+event.y-y);'>"+
    "    <td width=21 align=center><img width=12 width=12 src="+icon+"></td>"+
    "    <td style=\"font-family:宋体; font-size:12px; color:"+titleColor+";\"><span style='top:1;position:relative;cursor:default;'>"+titleWord+"</span></td>"+
    "    <td align=center width=30 style=font-size:16px;> "+
    "    </td>"+
    "  </tr>"+
    "  <tr>"+
    "    <td colspan=3><iframe frameborder=0 width=100% height=100% scrolling="+scr+" src="+fileName+"></iframe></td>"+
    "  </tr>"+
    "</table>"+
    "      <div style='position:absolute; left:"+(w-33)+"px; top:2px;width:30;height:20'><img border=0 width=12 height=12 alt=最小化 src="+minimizebar+" onclick=javascript:hhctrl.Click()><object id=hhctrl classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11'> <param name='Command' value='Minimize'> </object>"+
    "      <img border=0 width=12 height=12 alt=关闭 src="+closebar+" onclick=window.close();></div>"
      nbw.document.writeln(info)
    }
    </script>
    <!--下边是一个例子,可以删除。-->
    <body>
    <!----------------- 一个应用的例子 ----------------->
    <button onclick=noBorderWin('sorry.htm','500','240','#000000','#CCCCCC','一个无边窗口的测试例子','#000000','no');>open</button>
    </body>
      

  3.   

    呵呵~~
    有问题在这里可以问
    也欢迎来http://www.iecn.net坐坐