t

Loading Panel Widget

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

                                     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건
+
제목 글쓴이 날짜 조회
11-11-16 조회 3,419
11-11-15 조회 2,545
11-11-15 조회 3,168
11-11-15 조회 2,610
11-11-14 조회 2,694
11-11-14 조회 3,646
11-11-14 조회 3,439
11-11-14 조회 4,110
11-11-14 조회 2,737
11-11-14 조회 2,663
11-11-13 조회 3,964
11-11-12 조회 2,608
11-11-12 조회 2,725
11-11-12 조회 3,940
11-11-11 조회 2,852
11-11-11 조회 2,803
11-11-11 조회 2,487
11-11-11 조회 2,803
11-11-11 조회 3,937
11-11-11 조회 2,405
11-11-11 조회 4,642
11-11-11 조회 2,675
11-11-11 조회 2,500
11-11-11 조회 2,361
11-11-11 조회 2,769
11-11-11 조회 2,559
11-11-11 조회 2,555
11-11-10 조회 2,970
11-11-10 조회 2,437
11-11-10 조회 3,085
11-11-10 조회 3,635
11-11-10 조회 2,342
11-11-10 조회 2,474
11-11-10 조회 2,312
11-11-09 조회 2,499
11-11-09 조회 3,189
11-11-09 조회 2,681
11-11-09 조회 2,824
11-11-08 조회 2,588
11-11-08 조회 2,911
11-11-08 조회 2,255
11-11-08 조회 3,193
11-11-08 조회 2,478
11-11-08 조회 3,258
11-11-06 조회 1만
11-11-06 조회 2,565
11-11-06 조회 3,558
11-11-06 조회 3,356
11-11-06 조회 3,647
11-11-06 조회 3,831
11-11-05 조회 2,369
11-11-05 조회 2,532
11-11-04 조회 8,414
11-11-04 조회 2,498
11-11-04 조회 2,554
11-11-04 조회 3,559
11-11-04 조회 2,460
11-11-04 조회 2,635
11-11-03 조회 3,892
11-11-03 조회 2,560
11-11-03 조회 5,519
11-11-02 조회 5,788
11-11-01 조회 3,046
11-11-01 조회 2,498
11-11-01 조회 3,132
11-11-01 조회 2,444
11-11-01 조회 2,775
11-11-01 조회 2,297
11-11-01 조회 9,309
11-11-01 조회 2,862
11-10-31 조회 2,251
11-10-27 조회 2,508
11-10-26 조회 3,110
11-10-26 조회 2,594
11-10-26 조회 2,447
11-10-26 조회 2,487
11-10-26 조회 2,380
11-10-25 조회 2,407
11-10-25 조회 2,506
11-10-25 조회 2,450
11-10-25 조회 2,427
11-10-24 조회 2,469
11-10-24 조회 2,729
11-10-24 조회 2,737
11-10-23 조회 3,092
11-10-23 조회 2,690
11-10-23 조회 2,588
11-10-21 조회 2,454
11-10-21 조회 2,389
11-10-21 조회 2,358
11-10-21 조회 2,691
11-10-20 조회 3,928
11-10-19 조회 2,409
11-10-19 조회 2,795
11-10-19 조회 3,913
11-10-19 조회 3,067
11-10-19 조회 2,782
11-10-19 조회 6,605
11-10-18 조회 3,933
11-10-18 조회 2,518