t

Loading Panel Widget

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

                                     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,188건
+
제목 글쓴이 날짜 조회
12-04-10 조회 3,818
12-04-06 조회 5,262
12-04-06 조회 3,029
12-04-04 조회 4,119
12-04-02 조회 3,466
12-03-30 조회 3,398
12-03-29 조회 5,883
12-03-28 조회 3,298
12-03-28 조회 4,199
12-03-27 조회 4,425
12-03-23 조회 3,694
12-03-21 조회 3,416
12-03-20 조회 3,216
12-03-18 조회 3,043
12-03-15 조회 3,214
12-03-12 조회 3,260
12-03-12 조회 3,235
12-03-08 조회 3,522
12-03-03 조회 3,574
12-03-03 조회 3,195
12-02-29 조회 3,400
12-02-28 조회 3,488
12-02-28 조회 3,304
12-02-28 조회 3,412
12-02-27 조회 3,822
12-02-27 조회 3,206
12-02-24 조회 3,411
12-02-24 조회 3,229
12-02-23 조회 3,634
12-02-20 조회 3,517
12-02-20 조회 4,012
12-02-17 조회 3,980
12-02-16 조회 3,081
12-02-15 조회 3,351
12-02-15 조회 3,498
12-02-14 조회 3,400
12-02-08 조회 3,408
12-02-06 조회 3,381
12-02-06 조회 3,820
12-01-25 조회 4,074
12-01-21 조회 3,973
12-01-20 조회 6,093
12-01-15 조회 3,591
12-01-15 조회 3,551
12-01-14 조회 3,447
12-01-14 조회 3,588
12-01-14 조회 3,316
12-01-12 조회 3,920
12-01-12 조회 4,198
12-01-10 조회 3,526
12-01-10 조회 4,324
12-01-09 조회 3,686
12-01-08 조회 6,950
12-01-08 조회 3,159
12-01-07 조회 3,506
12-01-06 조회 3,521
12-01-04 조회 3,662
12-01-03 조회 3,524
12-01-02 조회 3,920
12-01-02 조회 3,115
12-01-01 조회 4,034
12-01-01 조회 3,382
11-12-31 조회 3,629
11-12-31 조회 3,741
11-12-31 조회 3,573
11-12-30 조회 3,801
11-12-30 조회 4,986
11-12-30 조회 4,101
11-12-30 조회 4,255
11-12-30 조회 3,730
11-12-30 조회 3,452
11-12-30 조회 3,414
11-12-29 조회 3,179
11-12-22 조회 3,374
11-12-21 조회 3,280
11-12-20 조회 3,593
11-12-15 조회 5,375
11-12-15 조회 4,386
11-12-14 조회 5,408
11-12-12 조회 3,598
11-12-03 조회 3,360
11-11-26 조회 3,389
11-11-19 조회 3,667
11-11-01 조회 2,966
11-10-23 조회 2,629
11-10-21 조회 2,607
11-10-15 조회 3,117
11-10-15 조회 2,849
11-10-15 조회 3,520
11-10-15 조회 2,745
11-10-14 조회 2,784
11-10-13 조회 2,560
11-10-11 조회 2,806
11-10-10 조회 2,625
11-09-30 조회 3,487
11-09-30 조회 2,912
11-09-29 조회 4,713
11-09-29 조회 2,605
11-09-23 조회 2,626
11-09-16 조회 2,962