晴明的博客园 GitHub      CodePen      CodeWars     
摘要: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Touch</title> <meta name="viewport" content="width=device-width, user-scalable=no"> </head 阅读全文
posted @ 2016-02-18 13:53 晴明桑 阅读(1956) 评论(0) 推荐(0) 编辑
摘要: console.log(document.body.scrollHeight); var a = document.body.scrollHeight; window.addEventListener("scroll", function(event) { var scrollTop = docum 阅读全文
posted @ 2016-02-18 11:05 晴明桑 阅读(6107) 评论(0) 推荐(1) 编辑
摘要: window.addEventListener('wheel', function(event) { //或mousewheel。但是他们都不兼容 firefox console.log(event.wheelDelta); //上 120,下 -120 }) window.addEventList 阅读全文
posted @ 2016-02-18 10:40 晴明桑 阅读(599) 评论(0) 推荐(1) 编辑
摘要: <html> <head> <meta charset="UTF-8"> <title>insertAdjacentHTML</title> </head> <body> <div id="paral" style="background:lavender;min-height:100px;bord 阅读全文
posted @ 2016-02-17 17:57 晴明桑 阅读(123) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>circleLoading</title> <style type="text/css"> .sk-circle { margin: 40px auto; width: 40px; 阅读全文
posted @ 2016-02-17 17:54 晴明桑 阅读(267) 评论(0) 推荐(0) 编辑
摘要: //var arr = new Array(1,12,4,124.45,8,99998,456);var arr = [1,12,4,124.45,8,99998,456];var a = Math.max.apply(Math,arr);var b = Math.max.apply({},arr) 阅读全文
posted @ 2016-02-16 11:13 晴明桑 阅读(132) 评论(0) 推荐(0) 编辑
摘要: <!doctype html> <!--[if lt IE 8[>小于IE8的版本可见<![endif]> <!--[if lte IE 8]> 小于等于IE8版本可见<![endif]--> <!--[if IE 8]>只有IE8版本可见<![endif]--> <!--[if gt IE 8]> 阅读全文
posted @ 2016-02-16 01:26 晴明桑 阅读(172) 评论(0) 推荐(0) 编辑
摘要: function getLocation(callback){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition( function(p){ callback(p.coords.latitude, p.coords 阅读全文
posted @ 2016-02-16 01:05 晴明桑 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Date.prototype.Format = function(formatStr) { var str = formatStr; var Week = ['日', '一', '二', '三', '四', '五', '六']; str = str.replace(/yyyy|YYYY/, this 阅读全文
posted @ 2016-02-16 01:03 晴明桑 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 华为360*640??? 未测document.documentElement #实际高度为0 <body><div id="a" style="background:red;"></div> </body> #超过全屏 <body> <div id="a" style="background:re 阅读全文
posted @ 2016-02-04 16:32 晴明桑 阅读(159) 评论(0) 推荐(0) 编辑