当前位置: 首页 > 图文教程 > 网页制作 > Dreamweaver > 巧制可全屏拖动的图片

Dreamweaver
网页设计赏析:易趣网店首页布局分析
Dreamweaver 8 新功能抢先预览
Dreamweaver 8中文版图文快报
分栏及回复的实现-Dreamweaver构建Blog
站点统计-Dreamweaver构建Blog
构建开发环境-Dreamweaver构建Blog
Dreamweaver 8 BETA2版新功能图文快报
站内搜索的实现-Dreamweaver构建BlogBLOG
数据库的设计和连接-Dreamweaver构建Blog
用户注册的实现-Dreamweaver构建Blog
构建Blog全程实录-Dreamweaver构建Blog
首页的实现-Dreamweaver构建Blog
管理员页面的实现-Dreamweaver构建Blog全程实录
巧用Dreamweaver制作复杂交换图像
Dreamweaver MX全新接触(上)
用Dreamweaver为网页图像添特效
用Dreamweaver描摹图像
寻找Dreamweaver鲜为人知的小秘诀
用Dreamweaver制作拖拽效果
用Dreamweaver进行网页优化

Dreamweaver 中的 巧制可全屏拖动的图片


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-23   浏览: 47 ::
收藏到网摘: n/a

    我们可以用鼠标把的层在页面内拖动,但要全屏拖动就困难了,下面是一种实现的方法:

制作步骤:

一、准备图片,取名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="/upload/tech/20091123/20091123141206_0d3180d672e08b4c5312dcdafdf6ef36.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>

好了,保存看看效果吧!