- 浏览: 51441 次
- 性别:
- 来自: 深圳
<!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> <title> new document </title> <meta name="generator" content="editplus" /> <meta name="author" content="" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <style type="text/css"> <!-- div{width:100px;height:100px;_padding-left:26px;} #id_click{border:1px solid #FddD33;float:left;} .sss{border:1px solid #F0dD33;float:left;} .exceptme{border:1px solid #00dD33;float:left;} .includeme{border:1px solid #Fd0033;float:left;} --> </style> </head> <body> <div id="id_click"></div> <div id="sss" class="sss"></div> <div id="exceptme" class="exceptme"></div> <div id="includeme" class="includeme"></div> </body> <script src="http://www.pingan.com/app_js/jquery-1.3.2.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> <!-- function domEvent(){} domEvent.prototype = { objtoarr:function (obj){ var arr = [],m=0; if(obj.length>1){ while(m<obj.length){ arr[m] = obj[m]; m++; } }else{ arr[0]=obj } return arr; } ,dom_exceptjs:function (){ var obj_dom = document.getElementsByTagName("body").item(0).children; var obj_script = document.getElementsByTagName("script"); var m=0, n=0, arr_dom=[], arr_script=[]; arr_dom = this.objtoarr(obj_dom); arr_script = this.objtoarr(obj_script); for(var i=0; i<arr_dom.length;i++){ for(var j=0;j<arr_script.length;j++){ if(arr_dom[i]==arr_script[j]){ arr_dom.splice(i,1); } } } return arr_dom; } ,removeunusedom:function (total, goal){ for(var i=0;i<total.length;i++){ if(total[i]==goal){ total.splice(i,1); return total; } } return false; } ,addEvent:function (dom,type,func){ if(document.attachEvent){ dom.attachEvent("on"+type,func);//ie } if(document.addEventListener){ dom.addEventListener(type,func,true);//mozillar } } ,removeEvent:function (dom,type,func){ if(document.attachEvent){ dom.detachEvent("on"+type,func); } if(document.addEventListener){ dom.removeEventListener(type,func,true); } } } var actdemo = new domEvent(); (function(){ var toa_AddEvent = actdemo.removeunusedom(actdemo.objtoarr(document.getElementsByTagName("div")),document.getElementById("exceptme")); for(var i=0;i<toa_AddEvent.length;i++){ //alert("00"); /*actdemo.addEvent(toa_AddEvent[i],"click",function(){ //var dom = toa_AddEvent[i]; alert(this.getAttribute("id")); })*/ actdemo.addEvent(toa_AddEvent[i],"click",function(e){ var target = e.srcElement || e.target; alert(target.getAttribute("id")); }) } })() //--> </script> </html>
发表评论
-
JS的replace方法
2011-08-05 10:34 1138from http://www.cnblogs.com/mxw ... -
要写出在各大主流浏览器上都兼容的JS代码,就要关注他们的区别,下是IE和FF综合考虑的通用DOM!
2011-08-04 14:36 896来源于 http://hi.baidu.com/g ... -
<input type="text" id="start" />输入true取布尔true
2011-07-28 14:22 832"true" and true is di ... -
Js获取当前日期时间+日期验证+判断闰年+日期的天数差+日期格式化+JS判断某年某月有多少天
2011-07-27 17:47 4717字符串转日期型+Js当前日期时间+日期验证+判断闰年+日期的天 ... -
高效http页面优化法则一【JS对DOM的操作】
2011-07-08 10:58 996很多人都认为JS的效率 ... -
form page jump
2011-07-07 10:49 826页面跳转 <input type="hidd ... -
jquery widget sample
2011-07-06 08:39 3407<!DOCTYPE html PUBLIC &quo ... -
jquery apply wait for update
2011-07-05 10:36 1622<!DOCTYPE html PUBLIC &quo ... -
deal with a great quantity domelements add event wait for update
2011-06-29 14:34 1120<!DOCTYPE html PUBLIC " ... -
JS中的attachEvent、addEventListener如何传递参数
2011-06-29 14:02 6243<!DOCTYPE html PUBLIC " ... -
window.onload 和 $(document).ready 区别 待续......
2011-06-27 09:50 2717jquery 学习之一(js中window ... -
js operate frame
2011-06-14 14:04 1167我的页面框架如下 <frameset rows=&quo ... -
js中frame的调用
2011-06-14 12:27 1016js中frame的调用 关键词 ... -
js 事件冒泡 和其它问题
2011-06-10 09:25 779js事件冒泡 <html> <head> ... -
js inner iframe get dom of parent
2011-06-02 15:00 702parent.$("#id");//jqu ... -
ajax
2011-05-27 14:18 611<!DOCTYPE html PUBLIC " ... -
count down 倒计时
2011-05-13 12:42 550<!DOCTYPE html PUBLIC " ... -
js IE与FireFox的兼容性问题 事件
2011-05-13 09:16 987# window.event * IE:有windo ... -
deal with href remove the same element
2011-05-11 09:38 771var url="http://zhidao.bai ... -
document.form.item 问题集合的(0)和[0]取法
2011-05-09 15:10 1893<!DOCTYPE html PUBLIC " ...
相关推荐
These eight minibooks get you started, explain standards, and help you connect all the dots to create sites with pizzazz. This handy, one–stop guide catches you up on XHTML basics and CSS ...
Going well beyond the basics of how to use Photoshop Elements—and weighing in at more than 672 pages—Photoshop Elements 13 All-in-One For Dummies is the most comprehensive Elements book on the ...
In just one hour a day, you’ll learn the skills you need to design, create, and maintain a professional-looking website. No previous experience required. By following each short, one-hour lesson in ...
- FIX: After deleting the selected points in the TFlexPanel.DeleteSelectedPoints the all figures with one point also deleted. - FIX: When the curve contain more then one figure and they were all ...
This completely updated second edition covers everything you need to know to get up-to-speed with JavaScript development and add dynamic enhancements to web pages, right from the basics. As well as ...
Concepts are presented in a "to-the-point" style to cater to the busy individual. With this book, you can learn HTML and CSS in just one day and start coding immediately. How is this book different.....
To add a new job login workflow In the Login Setup Folders ...Event Node: Defines a branch of the workflow that will be executed in response to a system-triggered event. Click OK to save your workflow.
Add Python to the search path on Windows
How to access and update part of the page using code. How to use JavaScript to communicate with the server and retrieve data. How to use JavaScript to for form validation and user feedback. How to use...
✨All In 1 Sprite Shader✨ is an all in one solution to add cool popular sprite and UI combinable effects to your project in the easiest and fastest way possible.
Plugin for removing import restrictions. Wordpress plugin add-on all in one wp migration
spcifically addresses optimisation of calculations, both in the add-in and in the workbook. The example C++ class described in the first edition that wraps the xloper data type has not only been ...
Download the 2013 v1 update to access the new TileControl to achieve a Windows 8 look and feel in your desktop apps as well as feature enhancements for Reports, Editor, and Scheduler. See the what's ...
Download the 2013 v1 update to access the new TileControl to achieve a Windows 8 look and feel in your desktop apps as well as feature enhancements for Reports, Editor, and Scheduler. See the what's ...
VC6 add files to project失效解决方法
dom4j常用方法 i.SAXReader sr = new SAXReader(); 生成解析器对象 ii.解析器对象.read(file对象); 解析文件生成Document对象 iii.文档对象.getRootElement() 获取跟元素节点 iv.元素节点.elements() 获取到指定...
This directive has only one attribute named as file, which is used to include a file in the jsp page at the translation time. <jsp:include page = " ">:- This is known as the include standard action....
Download the 2013 v1 update to access the new TileControl to achieve a Windows 8 look and feel in your desktop apps as well as feature enhancements for Reports, Editor, and Scheduler. See the what's ...
The example add-in project included on the CD ROM is intended to demonstrate some of the most important or difficult concepts described in the book, as well as the possibilities that are opened up ...