时间: 2021-07-31 作者:daque
咱们不妨用鼠标把dreamweaver的层在页面内拖动,但要全屏拖动就艰巨了,底下是一种实行的本领:
创造办法:
一、筹备图片,取名http://www.okasp.com/techinfo/back.jpg,如次:
二、建一个htm文献取名drag.htm,并写入下列代码:
< html> < head> < title>可拖动的图片< /title> < meta http-equiv="content-type" content="text/html; charset=utf8"> < /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="http://www.okasp.com/techinfo/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=utf8"> < 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>
好了,生存看看功效吧!