t

Loading Panel Widget

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

                                     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-01-22 조회 3,687
12-01-21 조회 3,041
12-01-19 조회 4,882
12-01-18 조회 2,898
12-01-18 조회 2,853
12-01-18 조회 3,048
12-01-17 조회 2,833
12-01-17 조회 3,101
12-01-14 조회 1.1만
12-01-14 조회 3,628
12-01-14 조회 3,943
12-01-11 조회 3,391
12-01-11 조회 3,126
12-01-11 조회 3,124
12-01-11 조회 3,233
12-01-11 조회 3,447
12-01-11 조회 2,765
12-01-10 조회 3,081
12-01-10 조회 2,874
12-01-10 조회 2,905
12-01-09 조회 2,893
12-01-08 조회 2,982
12-01-07 조회 2,975
12-01-06 조회 2,715
12-01-06 조회 2,831
12-01-05 조회 2,818
12-01-02 조회 2,974
11-12-29 조회 2,963
11-12-28 조회 2,940
11-12-28 조회 2,851
11-12-27 조회 3,066
11-12-23 조회 2,812
11-12-23 조회 2,936
11-12-21 조회 3,931
11-12-21 조회 2,967
11-12-19 조회 2,899
11-12-14 조회 4,317
11-12-08 조회 3,458
11-12-08 조회 4,104
11-12-07 조회 4,380
11-12-06 조회 4,281
11-12-06 조회 3,664
11-12-05 조회 3,308
11-12-05 조회 4,903
11-12-04 조회 3,302
11-12-03 조회 3,613
11-12-02 조회 3,537
11-12-02 조회 3,521
11-12-02 조회 2,851
11-12-01 조회 2,841
11-12-01 조회 3,731
11-12-01 조회 2,818
11-11-29 조회 5,675
11-11-23 조회 3,616
11-11-23 조회 3,962
11-11-22 조회 3,957
11-11-22 조회 3,011
11-11-21 조회 3,542
11-11-21 조회 2,841
11-11-18 조회 3,957
11-11-18 조회 3,085
11-11-17 조회 2,969
11-11-17 조회 2,989
11-11-17 조회 4,564
11-11-11 조회 2,841
11-11-11 조회 2,837
11-11-11 조회 3,966
11-11-11 조회 4,671
11-11-08 조회 2,972
11-11-06 조회 3,411
11-11-06 조회 3,718
11-10-21 조회 2,516
11-10-21 조회 2,432
11-10-19 조회 2,498
11-10-19 조회 4,004
11-10-08 조회 2,532
11-10-06 조회 4,223
11-10-01 조회 2,633
11-09-30 조회 2,599
11-09-29 조회 2,590
11-09-26 조회 2,461
11-09-23 조회 2,476
11-09-23 조회 2,222
11-09-22 조회 2,800
11-09-09 조회 3,107
11-08-30 조회 4,192
11-08-23 조회 2,229
11-08-12 조회 2,424
11-08-04 조회 3,988
11-07-01 조회 2,968
11-06-09 조회 2,605
11-05-17 조회 2,734
11-05-07 조회 2,988
11-04-21 조회 2,675
11-04-12 조회 2,533
11-04-11 조회 3,619
11-02-11 조회 2,736
11-02-08 조회 2,211
11-01-11 조회 2,586
10-11-26 조회 3,912