t

Loading Panel Widget

· 2011-11-01 (화) 17:47:24 · 3230

                                     A YUI Loading Panel Widget


아래를 추가해서 사용하세요.
var loadingPanel = new yuiLoadingPanel();

//loadingPanel.show();
//loadingPanel.show("Processing...");
//loadingPanel.hide();

The user can close the loading box by clicking on the cancel link. If you want to handle this situation, you can subscribe to the cancelEvent:

loadingPanel.cancelEvent.subscribe(function(e, a, o){
  alert('You clicked cancel!');
});

loadingpanel.js:

$D = YAHOO.util.Dom;
$E = YAHOO.util.Event;
var yuiLoadingPanel = function(conf){
    conf = conf == undefined ? new Array() : conf;
    conf.id = conf.id == undefined ? 'yuiLoadingPanel':confi.id;
    conf.header = conf.header == undefined ? 'Loading, please wait...':conf.header;
    conf.width = conf.width == undefined ? '240px':conf.width;
    this.conf = conf;
    this.cancelEvent = new YAHOO.util.CustomEvent("cancelEvent", this);
    this.init();
	
};

yuiLoadingPanel.prototype = {
    init:function(){
        var loadingPanel = new YAHOO.widget.Panel(this.conf.id,{
            width:this.conf.width,
	    fixedcenter:true,
            close:false,
            draggable:false,
            modal:true,
            visible:false
        });
    
       loadingPanel.setBody(this.conf.header + 
               '<img src="http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/gp/rel_interstitial_loading.gif" />');
               loadingPanel.render(document.body);
               $D.addClass(loadingPanel.id, 'tcc_lightboxLoader');
               var cancelLink = document.createElement('a');
               $D.setStyle(cancelLink, 'cursor', 'pointer');
               cancelLink.appendChild(document.createTextNode('Cancel'));
               $E.on(cancelLink, 'click', function(e, o){
       	           o.self.loadingPanel.hide();
       	           o.self.cancelEvent.fire();
               }, {self:this});
               loadingPanel.appendToBody(document.createElement('br'));
               loadingPanel.appendToBody(cancelLink);
               $D.setStyle(loadingPanel.body, 'text-align', 'center');
               $D.addClass(document.body, 'yui-skin-sam');
        this.loadingPanel = loadingPanel;
    },
    show:function(text){
        if(text != undefined){
            this.loadingPanel.setHeader(text);
        }else{
	    this.loadingPanel.setHeader(this.conf.header);
	}
	this.loadingPanel.show();
    },
    hide:function(){
        this.loadingPanel.hide();
    }
};


댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,187건
+
제목 글쓴이 날짜 조회
11-08-06 조회 2,968
11-08-06 조회 2,647
11-08-06 조회 3,356
11-08-05 조회 3,024
11-08-05 조회 2,886
11-08-05 조회 3,225
11-08-05 조회 3,163
11-08-05 조회 2,637
11-08-05 조회 2,546
11-08-05 조회 2,333
11-08-05 조회 2,535
11-08-05 조회 3,385
11-08-05 조회 4,018
11-08-04 조회 4,059
11-08-04 조회 3,585
11-08-04 조회 3,071
11-08-04 조회 3,087
11-08-04 조회 2,943
11-08-04 조회 3,201
11-08-04 조회 2,187
11-08-04 조회 3,076
11-08-04 조회 2,222
11-08-04 조회 2,721
11-08-04 조회 2,497
11-08-04 조회 3,696
11-08-03 조회 2,414
11-08-03 조회 4,212
11-08-03 조회 2,747
11-08-03 조회 2,540
11-08-03 조회 4,614
11-08-03 조회 2,247
11-08-03 조회 2,619
11-08-03 조회 2,070
11-08-02 조회 2,585
11-08-02 조회 2,158
11-08-02 조회 2,917
11-08-02 조회 2,259
11-08-02 조회 2,768
11-08-02 조회 2,312
11-08-02 조회 2,223
11-08-01 조회 2,139
11-08-01 조회 3,046
11-08-01 조회 2,356
11-08-01 조회 2,208
11-08-01 조회 2,232
11-07-30 조회 2,968
11-07-30 조회 2,936
11-07-29 조회 2,126
11-07-29 조회 4,071
11-07-28 조회 2,011
11-07-28 조회 2,240
11-07-28 조회 4,834
11-07-27 조회 2,278
11-07-27 조회 2,711
11-07-27 조회 3,002
11-07-26 조회 2,142
11-07-26 조회 2,264
11-07-26 조회 2,328
11-07-26 조회 2,672
11-07-26 조회 2,252
11-07-26 조회 2,561
11-07-26 조회 4,506
11-07-26 조회 2,903
11-07-26 조회 2,317
11-07-26 조회 3,126
11-07-25 조회 2,417
11-07-25 조회 2,003
11-07-25 조회 3,899
11-07-25 조회 2,303
11-07-25 조회 2,408
11-07-23 조회 2,643
11-07-23 조회 2,589
11-07-23 조회 2,745
11-07-22 조회 2,153
11-07-22 조회 4,085
11-07-22 조회 2,421
11-07-21 조회 3,063
11-07-21 조회 2,598
11-07-21 조회 2,703
11-07-21 조회 2,364
11-07-20 조회 2,602
11-07-20 조회 2,170
11-07-20 조회 2,224
11-07-20 조회 2,977
11-07-20 조회 2,801
11-07-20 조회 2,591
11-07-20 조회 2,642
11-07-20 조회 3,544
11-07-20 조회 3,227
11-07-19 조회 2,163
11-07-19 조회 2,992
11-07-19 조회 2,862
11-07-19 조회 2,871
11-07-18 조회 2,399
11-07-18 조회 2,387
11-07-18 조회 2,354
11-07-18 조회 2,347
11-07-18 조회 3,024
11-07-18 조회 2,395
11-07-17 조회 2,639