我們可以用滑鼠把 Dreamweaver 的圖層在頁面內拖動,但要「全屏拖動」就困難了。下面是一種實現方法:
製作步驟:
一、準備圖片,取名 back.jpg,如下:

二、建一個 htm 檔取名 drag.htm,並寫入下列程式碼:
<HTML>
<head>
<title>可拖動的圖片</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000" scroll=no topmargin=0 leftmargin=0 onmousedown="x=event.x;y=event.y;setCapture()" onmouseup="releaseCapture()" onmousemove="if(event.button==1)top.moveTo(screenLeft+event.x-x,screenTop+event.y-y)" ondblclick="self.close()">
<img src="back.jpg" width="120" height="120" style="cursor:hand;border:3 gold ridge">
</body>
</html>
如此 drag.htm 便是一個可以被拖動的頁面。
三、在其他頁面中調用 drag.htm,加上下面的程式碼:
<head>
<title>可全屏拖動的圖片</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function drag(){
var win;
win=window.open("drag.htm","","fullscreen");
win.moveTo(200,200);
win.resizeTo(126,126);
win.focus();
}
</script>
</head>
並用連結打開:
<a href="javascript:drag()">點擊這裡</a>
好了,儲存看看效果吧!點擊後會彈出一個可拖動的視窗,你可以用滑鼠把它拖到螢幕任何位置,雙擊即可關閉。