您目前尚未登陆,请选择【登陆】或【注册
首页->其他源码->漂亮许愿墙前台程序源码>>js/genmove.js>>代码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:漂亮许愿墙前台程序源码


当前文件路径:AspNetXuYuanQiang/js/genmove.js 文件类型
普通视图
		            
1/////////////////////////////////////////////////////////////////////// 2// This script was designed by Erik Arvidsson for WebFX // 3// // 4// For more info and examples see: http://webfx.eae.net // 5// or send mail to erik@eae.net // 6// // 7// Feel free to use this code as lomg as this disclaimer is // 8// intact. // 9/////////////////////////////////////////////////////////////////////// 10 11var checkZIndex = true; 12 13var dragobject = null; 14var tx; 15var ty; 16 17var ie5 = document.all != null && document.getElementsByTagName != null; 18 19function getReal(el) { 20 temp = el; 21 22 while ((temp != null) && (temp.tagName != "BODY")) { 23 if ((temp.className == "moveme") || (temp.className == "handle")){ 24 el = temp; 25 return el; 26 } 27 temp = temp.parentElement; 28 } 29 return el; 30} 31 32 33function moveme_onmousedown() { 34 el = getReal(window.event.srcElement) 35 36 if (el.className == "moveme" || el.className == "handle") { 37 if (el.className == "handle") { 38 tmp = el.getAttribute("handlefor"); 39 if (tmp == null) { 40 dragobject = null; 41 return; 42 } 43 else 44 dragobject = eval(tmp); 45 } 46 else 47 dragobject = el; 48 49 if (checkZIndex) makeOnTop(dragobject); 50 51 ty = window.event.clientY - getTopPos(dragobject); 52 tx = window.event.clientX - getLeftPos(dragobject); 53 54 window.event.returnValue = false; 55 window.event.cancelBubble = true; 56 } 57 else { 58 dragobject = null; 59 } 60} 61 62function moveme_onmouseup() { 63 if(dragobject) { 64 dragobject = null; 65 } 66} 67 68function moveme_onmousemove() { 69 if (dragobject) { 70 if (window.event.clientX >= 0 && window.event.clientY >= 0) { 71 dragobject.style.left = window.event.clientX - tx; 72 dragobject.style.top = window.event.clientY - ty; 73 } 74 window.event.returnValue = false; 75 window.event.cancelBubble = true; 76 } 77} 78 79function getLeftPos(el) { 80 if (ie5) { 81 if (el.currentStyle.left == "auto") 82 return 0; 83 else 84 return parseInt(el.currentStyle.left); 85 } 86 else { 87 return el.style.pixelLeft; 88 } 89} 90 91function getTopPos(el) { 92 if (ie5) { 93 if (el.currentStyle.top == "auto") 94 return 0; 95 else 96 return parseInt(el.currentStyle.top); 97 } 98 else { 99 return el.style.pixelTop; 100 } 101} 102 103function makeOnTop(el) { 104 var daiz; 105 var max = 0; 106 var da = document.all; 107 108 for (var i=0; i<da.length; i++) { 109 daiz = da[i].style.zIndex; 110 if (daiz != "" && daiz > max) 111 max = daiz; 112 } 113 114 el.style.zIndex = max + 1; 115} 116 117if (document.all) { //This only works in IE4 or better 118 document.onmousedown = moveme_onmousedown; 119 document.onmouseup = moveme_onmouseup; 120 document.onmousemove = moveme_onmousemove; 121} 122 123document.write("<style>"); 124document.write(".moveme {cursor: move;}"); 125document.write(".handle {cursor: move;}"); 126document.write("</style>");
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:漂亮许愿墙前台程序源码

- SpaceBuilder v1.0正式版源码

- ASP.Net网络资源管理器 v2.0

- ASP.NET三层架构留言本项目源码

- 某公司人事工资管理系统源码

- 我的Asp.net三层聊天室源码

- Extjs简单版酒店管理系统

- 深圳某模具厂网站源码

- Asp.net学生寝室管理系统源码

51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号