爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
点击后弹出div窗口特效
点击后弹出div窗口特效
日期:2014-05-18 浏览次数:20152 次
以下是程序代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html;charset=gb2312" /> <meta name="keywords" content="站长,网页特效,js特效,广告代码,zzjs,zzjs.net,sky,www.zzjs.net,站长特效 网" /> <meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" /> <title>点击后弹出div窗口效果,sky整理收集。 </title> <style type="text/css"> .mask{position: absolute; top: 0px; left: 0px; filter: alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; background-color: #ffffff; z-index: 2; display: none;} /* 弹出基本资料div */ div.sample_popup {height:auto; border: 1px solid #327eca; width: 300px; } div.menu_form_header{ background: url('/image/1.jpg') repeat-x; } div.sample_popup div.menu_form_header { border-bottom: 0px; cursor: default; width:100%; height: 22px; line-height: 22px; vertical-align: middle; text-decoration: none; font-family: "Times New Roman", Serif; font-weight: 800; font-size: 13px; color: #206040; } div.menu_form_body { width:100%; height:150px; font-size:12px; background-color:#f1f8fe; } div.sample_popup input.menu_form_exit { float: right; margin: 4px 5px 0px 0px; cursor: pointer; } /*end: 弹出商品信息div */ </style> <script type="text/javascript"> /************************************************** * DivWindow.js **************************************************/ var DivWindow= function(popup/*最外层div id*/,popup_drag/*拖动div id*/,popup_exit/*退出按钮id*/ ,exitButton/*触发服务器端退出按钮id*/,varwidth,varheight,zindex){ this.popup =popup ; //窗口名称 this.popup_drag=popup_drag; this.height =varheight ; //窗口高度,并没用来设置窗口高度宽度,用来定位在屏幕的位置 this.width =varwidth ; //窗口宽度 this.popup_exit=popup_exit; this.exitButton=exitButton; this.zindex=zindex; this.init = function(){ //初始化窗口 this.popupShow(); this.startDrag(); //设置拖动 this.setCommond(); //设置关闭 DivWindow.ArrayW.push(document.getElementById(this.popup)); //存储窗口到数组 };this.init(); }; //存储窗口到数组 DivWindow.ArrayW = new Array(); //字符串连接类 DivWindow.StringBuild = function(){ this.arr = new Array(); this.push = function(str){ this.arr.push(str); }; this.toString = function(){ return this.arr.join(""); }; }; //欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 //拖动类 DivWindow.Drag = function(o ,oRoot){ var _self = this; //拖动对象 this.obj = (typeof oRoot != "undefined") ?oRoot : o; this.relLeft = 0; //记录横坐标 this.relTop = 0; //记录纵坐标 o.onselectstart = function(){ return false; }; o.onmousedown = function(e){ //鼠标按下 e = _self.fixE(e); _self.relLeft = e.clientX - _self.fixU(_self.obj.style.left); _self.relTop = e.clientY - _self.fixU(_self.obj.style.top); document.onmousemove = function(e){ _self.drag(e); //_self.obj.style.border = "1px dashed #000000"; //_self.obj.style.filter = "alpha(opacity=30)"; //_self.obj.style.opacity = "0.3"; }; document.onmouseup = function(){ _self.end(); //_self.obj.style.border = "1px solid #cccccc"; //_self.obj.style.borderBottom = "2px solid #E0E0E0"; //_self.obj.style.borderRight = "2px solid #E0E0E0"; //_self.obj.style.filter = "alpha(opacity=100)"; //_self.obj.style.opacity = "1"; }; }; this.drag = function(e){ //拖动 e = this.fixE(e); var l = e.clientX - this.relLeft; var t = e.clientY - this.relTop; if (t < 0) { t = 0; //防止头部消失 } this.obj.style.left = l +"px"; this.obj.style.top = t +"px"; }; this.end = function(){ //结束拖动 document.onmousemove = null; document.onmouseup = null; }; this.fixE = function(e){ //修复事件 if (typeof e
上一篇:狡猾的按钮特效
下一篇:拖动改变层大小脚本
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
搜狐与奇虎360或结盟对抗BAT
唯品会荣登“最贵中概股”的欢喜与哀愁
200美元英特尔Android笔记本行将到来
虚拟运营商们更像三大运营商的“二道贩子”
小米移动芯片:英伟达退出,终会加强与联发科合作
苹果App Store被大量刷榜:iTunes账号成帮凶
iPhone 6将于10月17日内地上市:售5288元起
Google要求硬件厂商捆绑预装应用的协议曝光
频繁自杀 折射媒体变革中的媒体人迷茫与压力并存
推荐阅读
更多>
顺丰O2O便利店将正式启动:涉及金融服务
高通拼抢国际芯片市场 联发科海外拓展难安心
联发科享用价钱战 专利难以摆脱高通
传苹果与雅虎协作信息提供 进一步摆脱谷歌
苹果大中华区业绩回暖 中移动贡献或低于预期
乐视今日临时停牌 受广电酝酿新规消息影响
盛大游戏走向衰落的根源:免费游戏模式惹的祸
完美入股盛大:一桩各怀心事的交易
微软谷歌高层访韩面前:忌惮三星的崛起
优酷土豆携手新浪微博 谋攻移动视频失地
国美电商开打价钱战 牟贵先言行矛盾受质疑
华为变阵:任正非调整三大业务布局
FDD牌照短期不会发放 联通电信暗自提速建网
组建铁塔公司倒逼运营商改革 或加速4G网建设
易信工具性优势突出 丁磊三板斧或先砍在飞信上
创维冲击500亿梦想:转型硬件和内容供应商
诺基亚因充电器问题暂停销售Lumia 2520平板电脑
薛蛮子取保后首次发微博表示:辜负你们了
中移动本月推手机钱包 iPhone遭边缘化
蘑菇街CEO陈琪:2015将回归社会化电商