t

Loading Panel Widget

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

                                     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-26 조회 3,827
12-04-24 조회 3,223
12-04-23 조회 4,553
12-04-22 조회 3,246
12-04-19 조회 3,329
12-04-18 조회 4,385
12-04-18 조회 3,096
12-04-17 조회 3,367
12-04-17 조회 5,127
12-04-16 조회 3,541
12-04-13 조회 3,086
12-04-09 조회 3,156
12-04-04 조회 3,929
12-04-01 조회 3,208
12-03-31 조회 3,599
12-03-30 조회 3,205
12-03-30 조회 3,871
12-03-26 조회 3,480
12-03-26 조회 3,059
12-03-22 조회 3,213
12-03-21 조회 3,071
12-03-19 조회 3,476
12-03-17 조회 3,505
12-03-14 조회 3,235
12-03-10 조회 3,916
12-03-09 조회 3,493
12-03-09 조회 3,324
12-03-08 조회 3,797
12-03-08 조회 3,968
12-03-08 조회 4,060
12-03-03 조회 3,308
12-03-02 조회 4,636
12-02-28 조회 3,171
12-02-27 조회 2,982
12-02-25 조회 3,128
12-02-24 조회 3,838
12-02-23 조회 3,102
12-02-22 조회 3,623
12-02-22 조회 5,395
12-02-22 조회 3,967
12-02-22 조회 4,287
12-02-18 조회 3,775
12-02-17 조회 2,999
12-02-17 조회 3,407
12-02-14 조회 3,479
12-02-13 조회 3,364
12-02-10 조회 1만
12-02-08 조회 3,021
12-02-07 조회 3,359
12-02-06 조회 3,087
12-02-05 조회 3,549
12-01-31 조회 3,475
12-01-30 조회 9,661
12-01-29 조회 3,817
12-01-26 조회 3,417
12-01-25 조회 4,029
12-01-24 조회 3,423
12-01-10 조회 3,734
12-01-10 조회 4,490
12-01-09 조회 3,270
12-01-08 조회 7,131
12-01-08 조회 3,655
12-01-07 조회 5,183
12-01-04 조회 3,887
12-01-02 조회 3,112
12-01-02 조회 3,164
12-01-02 조회 3,471
12-01-01 조회 3,104
11-12-31 조회 3,412
11-12-31 조회 3,090
11-12-30 조회 3,255
11-12-30 조회 3,408
11-12-29 조회 3,622
11-12-28 조회 3,716
11-12-26 조회 3,283
11-12-23 조회 3,503
11-12-22 조회 3,050
11-12-15 조회 4,137
11-12-08 조회 3,956
11-12-05 조회 3,294
11-12-04 조회 5,712
11-12-03 조회 3,572
11-12-02 조회 3,352
11-12-01 조회 5,429
11-11-30 조회 2,914
11-11-30 조회 2,812
11-11-28 조회 3,155
11-11-26 조회 3,335
11-11-25 조회 3,356
11-11-24 조회 2,952
11-11-22 조회 3,042
11-11-22 조회 2,886
11-11-17 조회 2,819
11-11-11 조회 2,818
11-11-09 조회 2,875
11-11-08 조회 3,251
11-11-08 조회 2,544
11-11-04 조회 3,625
11-11-01 조회 2,931
11-10-26 조회 2,518