摘要: MDN :The Document.documentElement read-only property returns the Element that is the root element of the document (for example, the element for HTML ... 阅读全文
posted @ 2015-06-08 17:09 林大勇 阅读(207) 评论(0) 推荐(0)
摘要: 思路:使用keyCode,阻止浏览器默认行为.运行效果:[点击这里] 1 2 3 4 5 6 21 22 23 24 25 View Code 阅读全文
posted @ 2015-06-08 16:29 林大勇 阅读(198) 评论(0) 推荐(0)
摘要: clientX和clientY为可视区鼠标的位置。1. 随鼠标移动的div块[runjs]当document有多个页面时,会出现问题。[runjs]2. 解决方案:scrollTop, scrollLeft需要注意scrollTop/scrollLeft的兼容性获取;scrollTop = docu... 阅读全文
posted @ 2015-06-08 15:40 林大勇 阅读(851) 评论(0) 推荐(0)
摘要: 要求:点击按钮时,下拉框显示;点击页面其他部分时,下拉框消失;1. 不靠谱代码 1 2 3 4 5 6 14 27 28 29 30 31 32 不靠谱原因:当点击按钮时,(1)点击事件在btn上触发并执行,此时下拉框显示;(2)事件一直向上... 阅读全文
posted @ 2015-06-08 15:19 林大勇 阅读(342) 评论(0) 推荐(0)
摘要: http://bbs.zhinengshe.com/thread-1199-1-1.html1. 在空白的页面加点击事件,是加在body上么 ? 1 2 3 4 5 6 13 14 15 16 2. document是什么 ? 1 2 3 4 5 ... 阅读全文
posted @ 2015-06-08 15:06 林大勇 阅读(279) 评论(0) 推荐(0)