码迷,mamicode.com
首页 > 其他好文 > 详细

组件的写成

时间:2014-07-16 23:11:42      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   color   os   art   

看人家老的,两种我分不太清楚:

 

似乎fancybox满足我的要求?感觉还不错的样子!!!!!!,但是这里面的参数是干什么的?

(function (window, document, $, undefined) {
    //todo
}(window, document, jQuery));

 

 

还有这样写的,为啥呢?有啥区别?

WebcamToy.Audio = (function (c) {
}(WebcamToy));

 

 

哈根达斯camera

WebcamToy.Camera = (function () {
})()

 

lottery.js

window.homeNav = {
    open:function(){
        //开始动画
        console.log("open");
    };
    close:function(){
        //结束动画

    };
}

 

定时器 ↓

var WebcamToy = {};
WebcamToy.RuntimeTimer=function(){
    var _this=this,endtime=180,current=0,timer;

    this.update=function(){
        current=0;
    }

    this.destroy=function(){
        clearInterval(timer);
        window.location.reload();
    }

    this.start=function(){
        timer=setInterval(function(){
            current++;
            if(current>=endtime){
                _this.destroy();
            }
        },1000);
    }

    var _init=function(){

        this.start();
    }

    _init.apply(this,arguments);
}

 

组件的写成,布布扣,bubuko.com

组件的写成

标签:des   style   blog   color   os   art   

原文地址:http://www.cnblogs.com/della/p/3811398.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!