摘要: //平滑滚动 12.5.24未完 <html> <style> *{ padding:0px; margin:0px; } html,body,div{ height:100%; } </style> <body> <div style='background-color:red'></div> < 阅读全文
posted @ 2017-05-24 23:56 hngbk 阅读(129) 评论(0) 推荐(0)
摘要: //demo <style> html,body {height:100%;} body {margin:0px;} div {height:100%;}</style><body> <div style="background:red;"></div> <div style="background 阅读全文
posted @ 2017-05-23 22:35 hngbk 阅读(185) 评论(0) 推荐(0)
摘要: //取二维数组最大值 var test=[[1,34],[456,2,3,44,234],[4567,1,4,5,6],[34,78,23,1]]; //1. junior function getMaxOne(arr){ var tmp=[]; for(var i=0;i<arr.length;i 阅读全文
posted @ 2017-05-22 23:03 hngbk 阅读(1204) 评论(0) 推荐(0)
摘要: 动态加载JavaScript减少不必要的文件加载,提高网页浏览速度 <!DOCTYPE html> <html><meta charset='utf8'><body><input type='button' value='动态加载JavaScript' onclick='loadJS()'></bo 阅读全文
posted @ 2017-05-18 23:41 hngbk 阅读(177) 评论(0) 推荐(0)
摘要: window.top引用顶层框架 if(top!=self){ //当当前非顶层框架,当前页面跳转 top.location.href=self.location.href; } 阅读全文
posted @ 2017-05-17 22:18 hngbk 阅读(157) 评论(0) 推荐(0)
摘要: 网页刷新 window.location.reload() (头部<meta http-equiv='refresh' content='10'> 实现自动刷新) window.history length 历史数量 window.history.back window.history.forwar 阅读全文
posted @ 2017-05-17 22:08 hngbk 阅读(98) 评论(0) 推荐(0)