test--构造函数写法

var obj = document.getElementById('setbg');


var smooth = new ImageSmooth(obj);
//smooth.fuzzy();




/*背景模糊*/ 
function ImageSmooth(obj){
    var elem,oldClass;
    elem = obj;
    oldClass = ( elem.className == '' ? '' : elem.className + ' ' ); 
    this.fuzzy = function(){
        elem.className = oldClass + 'blur';
    }

} 

 

posted @ 2014-08-19 11:39  Western Journey  阅读(161)  评论(0编辑  收藏  举报