摘要: 首先,处理字体,在网页:https://www.fontsquirrel.com/tools/webfont-generator 目前,@ font-face的支持 Firefox Opera Chrome Safari Internet Explorer 9 在旧的浏览器使用@ font-face 阅读全文
posted @ 2016-10-26 18:18 最爱小虾 阅读(647) 评论(0) 推荐(0) 编辑
摘要: 图片应做成响应式、(大尺寸图片建议)使用渐进式JPEG、使用mozJPEG,tinyPNG等工具对图片进行压缩; 压缩工具: http://c7sky.com/kraken-io-image-optimizer.html 这里主要讲类似于bannner等大图优化加载问题; 压缩工具: -TinyPN 阅读全文
posted @ 2016-10-26 17:56 最爱小虾 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 标准浏览器:document.documentElement.scrollTop; 谷歌浏览器:document.body.scrollTop; var scrollTop = document.documentElement.scrollTop || document.body.scrollTop 阅读全文
posted @ 2016-10-26 17:40 最爱小虾 阅读(158) 评论(0) 推荐(0) 编辑
摘要: -firstChild firstElementChild var oFirst = oUl.firstChild || oUl.firstElementChild; -lastChild lastElementChild var oLast = oUl.lastChild || oUl.lastE 阅读全文
posted @ 2016-10-26 16:26 最爱小虾 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 用js的style属性可以获得html标签的样式,但是不能获取非行间样式。 解决方法: 在IE下可以用currentStyle; 在FF下用getComputedStyle; 然而,为了让其兼容,解决方法,封装成getStyle事件: 3,函数本身也是对象,对象就有属性,函数有length属性,比如 阅读全文
posted @ 2016-10-26 15:21 最爱小虾 阅读(4630) 评论(2) 推荐(0) 编辑
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body><ul id="ul1"> <li></li> <li class="box"></li> <li></li> 阅读全文
posted @ 2016-10-26 15:11 最爱小虾 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 1、event document.onclick = function (e) {// IE// console.log(event.clientX,event.clientY);// FF// console.log(e.clientX,e.clientY);// if(e){// console 阅读全文
posted @ 2016-10-26 14:36 最爱小虾 阅读(219) 评论(0) 推荐(0) 编辑