t

Loading Panel Widget

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

                                     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-07-16 조회 2,967
11-07-16 조회 3,134
11-07-15 조회 2,640
11-07-13 조회 3,570
11-07-13 조회 2,797
11-07-12 조회 3,430
11-07-12 조회 3,010
11-07-12 조회 2,632
11-07-12 조회 4,812
11-07-12 조회 3,216
11-07-12 조회 2,600
11-07-12 조회 2,466
11-07-12 조회 3,387
11-07-11 조회 2,591
11-07-11 조회 2,432
11-07-11 조회 2,354
11-07-11 조회 3,752
11-07-11 조회 2,322
11-07-11 조회 2,565
11-07-11 조회 3,331
11-07-11 조회 2,481
11-07-09 조회 2,551
11-07-08 조회 3,084
11-07-08 조회 2,714
11-07-08 조회 2,814
11-07-08 조회 2,626
11-07-07 조회 3,995
11-07-07 조회 2,653
11-07-07 조회 2,269
11-07-06 조회 2,489
11-07-06 조회 2,309
11-07-05 조회 2,315
11-07-05 조회 2,208
11-07-05 조회 2,460
11-07-05 조회 2,780
11-07-04 조회 3,014
11-07-03 조회 2,687
11-07-02 조회 2,723
11-07-02 조회 2,523
11-07-01 조회 2,664
11-07-01 조회 2,944
11-07-01 조회 2,751
11-07-01 조회 3,074
11-06-29 조회 2,802
11-06-28 조회 2,613
11-06-28 조회 2,656
11-06-28 조회 2,640
11-06-28 조회 3,200
11-06-28 조회 3,240
11-06-28 조회 2,919
11-06-27 조회 3,089
11-06-27 조회 3,244
11-06-27 조회 2,191
11-06-27 조회 2,725
11-06-27 조회 2,163
11-06-26 조회 2,499
11-06-26 조회 2,922
11-06-26 조회 2,432
11-06-26 조회 2,473
11-06-25 조회 2,673
11-06-24 조회 2,816
11-06-24 조회 2,715
11-06-24 조회 2,456
11-06-24 조회 2,767
11-06-23 조회 2,904
11-06-23 조회 2,851
11-06-23 조회 2,436
11-06-23 조회 3,658
11-06-23 조회 1,965
11-06-22 조회 2,652
11-06-22 조회 2,460
11-06-22 조회 2,340
11-06-22 조회 2,916
11-06-22 조회 3,290
11-06-21 조회 2,733
11-06-21 조회 2,353
11-06-21 조회 2,386
11-06-20 조회 2,637
11-06-17 조회 2,970
11-06-16 조회 3,088
11-06-16 조회 2,124
11-06-16 조회 2,617
11-06-15 조회 2,579
11-06-15 조회 2,574
11-06-15 조회 3,326
11-06-15 조회 3,160
11-06-15 조회 3,035
11-06-14 조회 2,747
11-06-14 조회 2,731
11-06-14 조회 3,350
11-06-13 조회 2,545
11-06-13 조회 2,175
11-06-13 조회 2,479
11-06-13 조회 2,366
11-06-13 조회 2,890
11-06-13 조회 3,140
11-06-13 조회 2,838
11-06-12 조회 2,509
11-06-10 조회 2,591
11-06-10 조회 2,630