摘要: 根据笔者的经验,总结了setTimeout的几种使用方式:1.setTimeout("fun()",time),这是大部分人经常使用的。2.setTimeout(fun,time)只引用函数名字,也可运行,但是要注意的是:如果fun是某个对象的方法,则fun函数内的this此时被当做window。eg:var obj={ "p1":"obj的属性p1", "fun":function() { alert(this.p1); }, };setTimeout(obj.fun,1000); 运行后的结果,是undefin 阅读全文
posted @ 2012-06-29 19:00 diguanianzhu 阅读(1306) 评论(3) 推荐(0) 编辑
摘要: Meyer Reset/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain)*/html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, stron... 阅读全文
posted @ 2012-06-29 14:10 diguanianzhu 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 通过动态添加class的方式修改一个div的样式,总是不起作用。如下面的代码,id为“navigator”的元素,添加类.current_block,边框颜色确不变?Css代码#navigator { height: 100%; width: 200; position: absolute; left: 0; border: solid 2 #EEE;}.current_block { border: solid 2 #AE0;} 查找一些教材中(w3schools等),只说css的顺序是“元素上的style” > “文件头上的style元素” >“外部样... 阅读全文
posted @ 2012-06-29 13:20 diguanianzhu 阅读(8140) 评论(3) 推荐(2) 编辑