posted @ 2015-11-10 16:17 斯是陋室,惟吾德馨 阅读(174) 评论(0) 推荐(0) 编辑
摘要:
/*IE9以下不支持indexOf。所以重新写indexOf方法*/if( !Array.prototype.indexOf ){ Array.prototype.indexOf = function( item ){ var res =-1, a_index = null; ... 阅读全文
摘要:
function centerposition( obj ){ var wWidth = document.documentElement.clientwidth; var wHeight = document.documentElement.clientHeight; va... 阅读全文
posted @ 2015-10-31 17:08 斯是陋室,惟吾德馨 阅读(157) 评论(0) 推荐(0) 编辑
摘要:
function getStyle(obj attr){ return obj.currentStyle:obj.currentStyle[attr]:getComputedStyle(obj)[attr];}用js的style属性可以获得html标签的样式,但是不能获取非行间样式。那么怎么用js获... 阅读全文
posted @ 2015-10-31 16:21 斯是陋室,惟吾德馨 阅读(510) 评论(0) 推荐(0) 编辑
摘要:
普通的面向对象是这样的 1 function test(){}; 2 test.prototype.init = function(){ 3 alert('初始化成功'); 4 } 5 test.prototype.css = function(){ 6 alert(... 阅读全文
posted @ 2015-08-01 11:56 斯是陋室,惟吾德馨 阅读(200) 评论(0) 推荐(0) 编辑