t

Loading Panel Widget

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

                                     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,467
11-11-15 조회 2,578
11-11-15 조회 3,194
11-11-15 조회 2,641
11-11-14 조회 2,734
11-11-14 조회 3,691
11-11-14 조회 3,484
11-11-14 조회 4,160
11-11-14 조회 2,772
11-11-14 조회 2,685
11-11-13 조회 3,979
11-11-12 조회 2,623
11-11-12 조회 2,745
11-11-12 조회 3,964
11-11-11 조회 2,876
11-11-11 조회 2,824
11-11-11 조회 2,501
11-11-11 조회 2,813
11-11-11 조회 3,948
11-11-11 조회 2,414
11-11-11 조회 4,652
11-11-11 조회 2,686
11-11-11 조회 2,513
11-11-11 조회 2,383
11-11-11 조회 2,803
11-11-11 조회 2,589
11-11-11 조회 2,577
11-11-10 조회 3,001
11-11-10 조회 2,480
11-11-10 조회 3,114
11-11-10 조회 3,667
11-11-10 조회 2,374
11-11-10 조회 2,508
11-11-10 조회 2,339
11-11-09 조회 2,527
11-11-09 조회 3,219
11-11-09 조회 2,711
11-11-09 조회 2,856
11-11-08 조회 2,613
11-11-08 조회 2,938
11-11-08 조회 2,275
11-11-08 조회 3,228
11-11-08 조회 2,517
11-11-08 조회 3,296
11-11-06 조회 1만
11-11-06 조회 2,582
11-11-06 조회 3,573
11-11-06 조회 3,381
11-11-06 조회 3,689
11-11-06 조회 3,875
11-11-05 조회 2,420
11-11-05 조회 2,588
11-11-04 조회 8,472
11-11-04 조회 2,539
11-11-04 조회 2,595
11-11-04 조회 3,600
11-11-04 조회 2,493
11-11-04 조회 2,665
11-11-03 조회 3,929
11-11-03 조회 2,599
11-11-03 조회 5,562
11-11-02 조회 5,835
11-11-01 조회 3,108
11-11-01 조회 2,549
11-11-01 조회 3,168
11-11-01 조회 2,465
11-11-01 조회 2,799
11-11-01 조회 2,320
11-11-01 조회 9,346
11-11-01 조회 2,909
11-10-31 조회 2,296
11-10-27 조회 2,543
11-10-26 조회 3,139
11-10-26 조회 2,625
11-10-26 조회 2,490
11-10-26 조회 2,519
11-10-26 조회 2,406
11-10-25 조회 2,459
11-10-25 조회 2,545
11-10-25 조회 2,490
11-10-25 조회 2,472
11-10-24 조회 2,510
11-10-24 조회 2,773
11-10-24 조회 2,784
11-10-23 조회 3,145
11-10-23 조회 2,732
11-10-23 조회 2,628
11-10-21 조회 2,484
11-10-21 조회 2,415
11-10-21 조회 2,390
11-10-21 조회 2,769
11-10-20 조회 3,972
11-10-19 조회 2,452
11-10-19 조회 2,845
11-10-19 조회 3,968
11-10-19 조회 3,108
11-10-19 조회 2,824
11-10-19 조회 6,650
11-10-18 조회 3,987
11-10-18 조회 2,558