BOM浏览器对象模型
摘要:浏览器窗口的尺寸(浏览器的视口,不包括工具栏和滚动条)。(1)、对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari: window.innerHeight - 浏览器窗口的内部高度 window.innerWidth - 浏览器窗口的内部宽度(2)...
阅读全文
posted @
2015-05-07 16:54
转角遇到谁
阅读(271)
推荐(0) 编辑
console比较实用的方法
摘要:控制台(Console)是Firebug的第一个面板,也是最重要的面板,主要作用是显示网页加载过程中产生各类信息。firebug内置一个console对象,它提供了几种方法,主要作用是显示网页加载过程中产生各类信息。console.log() :用来取代alert()或document.write(...
阅读全文
posted @
2015-05-07 16:46
转角遇到谁
阅读(189)
推荐(0) 编辑
style、currentStyle、getComputedStyle的区别和用法
摘要:var oDiv=document.getElementById("test"); alert("style~~~~"+oDiv.style.color); //写在样式表里无法读取,只能得到写在行内的 //属性“getComputedStyle”的值为 null、未定义或不是 Function ...
阅读全文
posted @
2015-05-07 15:09
转角遇到谁
阅读(199)
推荐(0) 编辑
createDocumentFragment创建文档碎片节点
摘要:注:为什么不用appendChild()? 因为调用多次.appendChild(),每次都要刷新页面一次。效率也就大打折扣了
阅读全文
posted @
2015-05-07 14:45
转角遇到谁
阅读(203)
推荐(0) 编辑
setTimeout里如果有$(this),$(this)指的是谁?
摘要:$(".next").click(function(){ setTimeout(function(){$(this).addClass("gray");//指向的是window 而不是$(".next") },1000);})
阅读全文
posted @
2015-05-07 14:12
转角遇到谁
阅读(273)
推荐(0) 编辑
eval()函数可以把一个字符串当作一个JavaScript表达式一样去执行它
摘要:var arr=[1,2,3,4];//求和 var sum=eval(arr.join("+")); alert(sum);//返回number类型
阅读全文
posted @
2015-05-05 16:54
转角遇到谁
阅读(308)
推荐(0) 编辑
遮罩层特效(根据鼠标进入离开方向出现)
摘要:遮罩层特效(根据鼠标进入离开方向出现) Climber's Delight Climber's Delight Climber's Delight ...
阅读全文
posted @
2015-05-05 16:45
转角遇到谁
阅读(444)
推荐(0) 编辑
jquery之attr和prop区别
摘要:举例:$("input").attr("checked") //返回 checked 或 undefined$("input").prop("checked") //返回 true 或 false
阅读全文
posted @
2015-05-05 16:28
转角遇到谁
阅读(127)
推荐(0) 编辑
js封装类简单举例
摘要://构造函数function Cat(name,color){ this.name=name; this.color=color;}//原型Cat.prototype={ run:function(){ //操作 alert(this.name+"run"); }, mew:functio...
阅读全文
posted @
2015-05-05 16:08
转角遇到谁
阅读(206)
推荐(0) 编辑
自动换行 word-break:break-all和word-wrap:break-word
摘要:word-break:break-all和word-wrap:break-wordword-break:break-all 到达边界时它会把单词截断word-wrap:break-word 到达边界时它会把单词看成一个整体换到下一行
阅读全文
posted @
2015-05-05 15:59
转角遇到谁
阅读(147)
推荐(0) 编辑
css3之filter特效
摘要:1、grayscale用法: -moz-filter: grayscale(100%) ; -webkit-filter: grayscale(100%); -ms-filter: grayscale(100%); -o-filter: grayscale(100%); filter: graysc...
阅读全文
posted @
2015-05-05 15:31
转角遇到谁
阅读(226)
推荐(0) 编辑
背景图的定位技巧~如果你想定位的位置是距离右边20px,距离底部10px,怎么办?
摘要:一、使用background-position的四个值语法例如:background-position:right20pxbottom10px;/* ie7,ie8不支持 */二、使用 calc()比如:background-position:calc(100%-20px)calc(100%-10p...
阅读全文
posted @
2015-05-04 16:05
转角遇到谁
阅读(3376)
推荐(0) 编辑