Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1591049
  • 博文数量: 441
  • 博客积分: 20087
  • 博客等级: 上将
  • 技术积分: 3562
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-19 15:35
文章分类

全部博文(441)

文章存档

2014年(1)

2012年(1)

2011年(8)

2010年(16)

2009年(15)

2008年(152)

2007年(178)

2006年(70)

分类: 系统运维

2007-06-05 09:16:57

我们可以用鼠标把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 alt="巧制可全屏拖动的图片" src= 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>

好了,保存看看效果吧!

Web开发工具
阅读(896) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~