来自 新葡亰运维 2019-11-25 05:52 的文章
当前位置: 澳门新葡亰app > 新葡亰运维 > 正文

代码如下,代码如下

复制代码 代码如下:String.prototype.replaceAll = function{ return this.replace,s2); }; { /* * $-layer 0.1 - New Wave Javascript * * Copyright 2008 King Wong * $Date: 2008-10-09 $ */ var ___id___ = ""; var ___settings___ = {}; var isMouseDown = false; var currentElement = null; var dropCallbacks = {}; var dragCallbacks = {}; var bubblings = {}; var lastMouseX; var lastMouseY; var lastElemTop; var lastElemLeft; var dragStatus = {}; var holdingHandler = false; $.getMousePosition = function{ var posx = 0; var posy = 0; if var e = window.event; if { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } return { 'x': posx, 'y': posy }; }; $.updatePosition = function { var pos = $.getMousePosition; var spanX = ; var spanY = ; var _top = > 0 ? : 0; var _left = > 0 ? : 0; $.css; $.css; }; $.fn.ondrag = function{ return this.each{ dragCallbacks[this.id] = callback; }); }; $.fn.ondrop = function{ return this.each{ dropCallbacks[this.id] = callback; }); }; $.fn.dragOff = function(){ return this.each{ dragStatus[this.id] = 'off'; }); }; $.fn.dragOn = function(){ return this.each{ dragStatus[this.id] = 'on'; }); }; $.extend({ layerSettings:{ id:"layerdiv", width:220, height:220, templete:'

复制代码 代码如下:String.prototype.replaceAll = function{ return this.replace,s2); }; { /* * $-layer 0.1 - New Wave Javascript * * Copyright 2008 King Wong* $Date: 2008-10-09 $ */ var ___id___ = ""; var ___settings___ = {}; var isMouseDown = false; var currentElement = null; var dropCallbacks = {}; var dragCallbacks = {}; var bubblings = {}; var lastMouseX; var lastMouseY; var lastElemTop; var lastElemLeft; var dragStatus = {}; var holdingHandler = false; $.getMousePosition = function{ var posx = 0; var posy = 0; if var e = window.event; if { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } return { 'x': posx, 'y': posy }; }; $.updatePosition = function { var pos = $.getMousePosition; var spanX = ; var spanY = ; var _top = > 0 ? : 0; var _left = > 0 ? : 0; $.css; $.css; }; $.fn.ondrag = function{ return this.each{ dragCallbacks[this.id] = callback; }); }; $.fn.ondrop = function{ return this.each{ dropCallbacks[this.id] = callback; }); }; $.fn.dragOff = function(){ return this.each{ dragStatus[this.id] = 'off'; }); }; $.fn.dragOn = function(){ return this.each{ dragStatus[this.id] = 'on'; }); }; $.extend({ layerSettings:{ id:"layerdiv", width:220, height:220, templete:'

@title@close

@title@close

', content:'', title:'', isbg:true, opacity:0.3 }, layerSetup: function { $.extend( $.layerSettings, settings ); ___settings___[settings.id] = settings; ___id___ = settings.id; }, layershow:function(){ var __bw = $; var __bh = $ > $ ? $ : $; var _width = $.layerSettings.width; var _height = $.layerSettings.height; if(document.getElementById return; var _moveid = ___id___ + "_move"; var _titleid = ___id___ + "_title"; var _contentid = ___id___ + "_content"; var _cssurl = $.layerSettings.cssurl; var opacity = $.layerSettings.opacity; __index = $.layermaxindex(); var __left = > 0 ? /2 : 0; var __top = 100; var __bgDiv = '

', content:'', title:'', isbg:true, opacity:0.3 }, layerSetup: function { $.extend( $.layerSettings, settings ); ___settings___[settings.id] = settings; ___id___ = settings.id; }, layershow:function(){ var __bw = $; var __bh = $ > $ ? $ : $; var _width = $.layerSettings.width; var _height = $.layerSettings.height; if(document.getElementById return; var _moveid = ___id___ + "_move"; var _titleid = ___id___ + "_title"; var _contentid = ___id___ + "_content"; var _cssurl = $.layerSettings.cssurl; var opacity = $.layerSettings.opacity; __index = $.layermaxindex(); var __left = > 0 ? /2 : 0; var __top = 100; var __bgDiv = '

'; if { $.append.append('

'; if { $.append.append('

'); var _templete = $.layerSettings.templete; var __templete = _templete.replaceAll.replaceAll.replaceAll.replaceAll("@contentid@",_contentid).replaceAll("@title@",jQuery.layerSettings.title).replaceAll; $.append; $.append($.layerSettings.content); $.append($.layerSettings.title); var idd = ___id___; $.bind { $.layerclose; $.bind { var id = this.id; $.layerSetup; $.css("z-index",$.layermaxindex.bind { var pos = $.getMousePosition.mousemove{ if(isMouseDown && dragStatus[currentElement.id] != 'false'){ $.updatePosition; if(dragCallbacks[currentElement.id] != undefined){ dragCallbacks[currentElement.id]; } return false; } }); $.mouseup{ if(isMouseDown && dragStatus[currentElement.id] != 'false'){ isMouseDown = false; if(dropCallbacks[currentElement.id] != undefined){ dropCallbacks[currentElement.id]; } return false; } }); { bubblings[___id___] = true; dragStatus[___id___] = "on"; //setHandler bubblings[this.id] = true; dragStatus[_moveid] = "handler"; $.css; $.mousedown{ var id = this.id.replace; ___id___ = id; $.css("z-index",$.layermaxindex; $.layerSetup; if((dragStatus[___id___] == "off") || (dragStatus[___id___] == "handler" && !holdingHandler)) return bubblings["#"+___id___]; isMouseDown = true; currentElement = $; var pos = $.getMousePosition; lastMouseX = pos.x; lastMouseY = pos.y; lastElemTop = document.getElementById.offsetTop; lastElemLeft = document.getElementById.offsetLeft; $.updatePosition; holdingHandler = true; }); $.mouseup{ holdingHandler = false; }); //end setHandler })(); }, layerclose:function { $("#"+__id+"_background").remove.remove(); }, layermaxindex:function() { var ___index = 0; $.each{ var __tem = $; if { if { ___index = __tem + 1; } } }); return ___index; } }); }); 12下一页阅读全文

'); var _templete = $.layerSettings.templete; var __templete = _templete.replaceAll.replaceAll.replaceAll.replaceAll("@contentid@",_contentid).replaceAll("@title@",jQuery.layerSettings.title).replaceAll; $.append; $.append($.layerSettings.content); $.append($.layerSettings.title); var idd = ___id___; $.bind { $.layerclose; $.bind { var id = this.id; $.layerSetup; $.css("z-index",$.layermaxindex.bind { var pos = $.getMousePosition.mousemove{ if(isMouseDown && dragStatus[currentElement.id] != 'false'){ $.updatePosition; if(dragCallbacks[currentElement.id] != undefined){ dragCallbacks[currentElement.id]; } return false; } }); $.mouseup{ if(isMouseDown && dragStatus[currentElement.id] != 'false'){ isMouseDown = false; if(dropCallbacks[currentElement.id] != undefined){ dropCallbacks[currentElement.id]; } return false; } }); { bubblings[___id___] = true; dragStatus[___id___] = "on"; //setHandler bubblings[this.id] = true; dragStatus[_moveid] = "handler"; $.css; $.mousedown{ var id = this.id.replace; ___id___ = id; $.css("z-index",$.layermaxindex; $.layerSetup; if((dragStatus[___id___] == "off") || (dragStatus[___id___] == "handler" && !holdingHandler)) return bubblings["#"+___id___]; isMouseDown = true; currentElement = $; var pos = $.getMousePosition; lastMouseX = pos.x; lastMouseY = pos.y; lastElemTop = document.getElementById.offsetTop; lastElemLeft = document.getElementById.offsetLeft; $.updatePosition; holdingHandler = true; }); $.mouseup{ holdingHandler = false; }); //end setHandler })(); }, layerclose:function { $("#"+__id+"_background").remove.remove(); }, layermaxindex:function() { var ___index = 0; $.each{ var __tem = $; if { if { ___index = __tem + 1; } } }); return ___index; } }); });使用方法: 显示层: 复制代码 代码如下:function show() { $.layerSetup({ id:"abc",//弹出层的ID title:"test",//标题 content:'test',//内容 isbg:false,//是否显示背景遮照层 opacity:0.3,//背景遮照层的透明度,值越大透明度越低,0为完全透明,1为不透明 templete:'

'//模板 }); $.layershow关闭层: 复制代码 代码如下:$.layerclose; 注意:那个如果你的模板有CSS文件的话,就要直接引入到本页面就行了,这个简化版不能在别的框架弹出层的,所以也就没有了那个cssurl属性了,也没有target 属性了。 源码下载

本文由澳门新葡亰app发布于新葡亰运维,转载请注明出处:代码如下,代码如下

关键词: