02 2012 档案
摘要:效果图:TAB菜单完整代码:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>TAB</title><script
阅读全文
摘要:1.style属性是一个对象,如果不是内嵌样式,而是外部引入的,那么,alert(element.style.)是弹不出来的example:这样是height是获取不到的<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text
阅读全文
摘要:function: function getNextElement(node){ if(node.nodeType==1){ return node; } if(node.nextSibling){ return getNextElement(node.nextSibling); } return null; }实例代码:<!DOCTYPE html PUBLIC "-//W3C//DTD HTML...
阅读全文
摘要:<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>测试dtd</title><script type="text/javascript" languate="javascript"> //创建一个xml解析器 var xmldoc = new ActiveXObject("Microsoft.XMLDOM"); //开启校验
阅读全文
摘要:function insertAfter(newElement,targetElement){ var parent=targetElement.parentNode; if(parent.lastChild==targetElement){ parent.appendChild(newElement); }else{ parent.insertBefore(newElement,targetElement.nextSibling) } }相对于insertBefore()编写的i...
阅读全文
摘要:function addLoadEvent(func){ var oldonload=window.onload; if(typeof window.onload!='function'){ window.onload=func; }else{ window.onload=function(){ oldonload(); func(); } } }注意调用的时候:addLoadEvent(func);...
阅读全文
摘要:首先来看以下,一个father div, 一个son div.father{ border:1px solid red; width:100px; height:100px; margin:50px;}.son{ border:1px solid yellow; margin:5px;}html代码:<body> <div class="father"> <div class="son">son</div> </div></body>浏览器中的效果:给son div,添加positi
阅读全文
摘要:function addClass(element,value){ if(!element.className){ element.className=value; }else{ newClassName=element.className; newClassName+=" "; newClassName+=value; element.className=newClassName; ...
阅读全文

浙公网安备 33010602011771号