摘要: 阅读全文
posted @ 2017-12-26 11:05 超级玛丽和大力水手 阅读(507) 评论(0) 推荐(0)
摘要: 用该属性获取页面 URL 地址:window.location 对象所包含的属性属性 描述hash 从井号 (#) 开始的 URL(锚)host 主机名和当前 URL 的端口号hostname 当前 URL 的主机名href 完整的 URLpathname 当前 URL 的路径部分port 当前 U 阅读全文
posted @ 2017-11-17 10:15 超级玛丽和大力水手 阅读(415) 评论(0) 推荐(0)
摘要: window.onscroll=function(){ var t =document.body.scrollTop;//变量t就是滚动条滚动时,到顶部的距离 var l =document.body.scrollLeft;//变量l就是滚动条滚动时,到左部的距离 console.log(t,l) } 阅读全文
posted @ 2017-06-15 17:22 超级玛丽和大力水手 阅读(321) 评论(0) 推荐(0)
摘要: 1、最简单,最消耗资源的 2、选择性初始化 3、sina 4、yahoo 5、博客园 阅读全文
posted @ 2017-06-14 10:03 超级玛丽和大力水手 阅读(154) 评论(0) 推荐(0)
摘要: HTML精确定位:scrollLeft,scrollWidth,clientWidth,offsetWidth scrollHeight: 获取对象的滚动高度。 scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离 scrollTop:设置或获取位于对象最顶端和窗口中 阅读全文
posted @ 2017-06-12 18:00 超级玛丽和大力水手 阅读(146) 评论(0) 推荐(0)
摘要: var box=document.getElementById("box"); // 指定一个要移动底图的容器 var num=0; // 声明原始值num=0 box.onclick=function(){ // 一个触发事件 ... 阅读全文
posted @ 2017-06-08 15:32 超级玛丽和大力水手 阅读(665) 评论(0) 推荐(0)
摘要: var box=document.getElementById("box"); // 指定一个要移动底图的容器 var num=0; // 声明原始值num=0 box.onclick=function(){ // 一个触发事件 ... 阅读全文
posted @ 2017-06-08 15:23 超级玛丽和大力水手 阅读(202) 评论(0) 推荐(0)
摘要: // 页面跳转 var t=3;//设定跳转的时间 setInterval("refer()",1000); //启动1秒定时 function refer(){ if(t==0){ location.hr... 阅读全文
posted @ 2017-06-08 13:51 超级玛丽和大力水手 阅读(374) 评论(0) 推荐(0)
摘要: // 阻止事件冒泡 function stopBubble(e){ if(e && e.stopPropagation){ e.stopPropagation(); }else{ window.event.cancelBubble = true ... 阅读全文
posted @ 2017-05-31 10:52 超级玛丽和大力水手 阅读(124) 评论(0) 推荐(0)
摘要: 1 function getStyle(obj,attr){ 2 if(obj.currentStyle){ 3 return obj.currentStyle[attr] 4 }else{ 5 return getComputedStyle(obj)[attr] 6 ... 阅读全文
posted @ 2017-05-22 11:50 超级玛丽和大力水手 阅读(173) 评论(0) 推荐(0)