巧制可全屏拖动的图片

资讯 驱动中国 xuqingzhong 3,053 次阅读 0 条评论
分享 Q

 

 

制作步骤:

一、准备图片,取名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>

好了,保存看看效果吧!

图片 &quot &lt &gt &nbsp drag.ht
版权声明:本文由驱动中国整理发布,转载需注明出处与原文链接。如有疑问请联系 editor@qudong.com
本文价值 成为第一个评分的人
登录后为本文打分
网友评论0 条评论
正在回复 的评论取消
评论加载中…
🔐

登录后参与互动

评论、点赞均可赚积分
连续签到、邀请好友也有奖励 🎁

电脑端: 微信扫码登录 微信内: 一键登录

微信扫一扫

打开微信「扫一扫」,分享本文到朋友圈或好友