t

Loading Panel Widget

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

                                     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건
+
제목 글쓴이 날짜 조회
12-02-11 조회 3,187
12-02-11 조회 3,076
12-02-11 조회 3,513
12-02-10 조회 1만
12-02-10 조회 3,670
12-02-10 조회 4,635
12-02-09 조회 4,003
12-02-09 조회 3,563
12-02-09 조회 6,500
12-02-09 조회 3,214
12-02-08 조회 3,657
12-02-08 조회 3,058
12-02-08 조회 3,118
12-02-08 조회 4,067
12-02-08 조회 4,779
12-02-08 조회 3,113
12-02-07 조회 3,441
12-02-07 조회 3,375
12-02-07 조회 3,383
12-02-07 조회 2,688
12-02-07 조회 3,432
12-02-07 조회 2,977
12-02-06 조회 3,156
12-02-06 조회 3,049
12-02-06 조회 3,611
12-02-06 조회 4,050
12-02-06 조회 3,397
12-02-06 조회 1.2만
12-02-06 조회 4,327
12-02-06 조회 5,772
12-02-05 조회 2,856
12-02-05 조회 3,633
12-02-05 조회 3,037
12-02-04 조회 2,957
12-02-04 조회 2,951
12-02-04 조회 6,781
12-02-03 조회 3,956
12-02-03 조회 4,346
12-02-03 조회 2,849
12-02-03 조회 3,391
12-02-03 조회 3,979
12-02-02 조회 3,014
12-02-02 조회 3,787
12-02-02 조회 3,819
12-02-02 조회 5,486
12-02-02 조회 3,441
12-02-02 조회 4,703
12-02-02 조회 3,554
12-02-01 조회 3,386
12-02-01 조회 3,628
12-02-01 조회 4,055
12-02-01 조회 3,344
12-02-01 조회 2,891
12-01-31 조회 3,316
12-01-31 조회 3,564
12-01-31 조회 2,968
12-01-30 조회 9,737
12-01-30 조회 8,905
12-01-30 조회 2,881
12-01-30 조회 3,296
12-01-30 조회 3,385
12-01-30 조회 2,894
12-01-30 조회 3,061
12-01-29 조회 3,385
12-01-29 조회 3,250
12-01-29 조회 4,713
12-01-29 조회 2,893
12-01-29 조회 3,603
12-01-29 조회 3,894
12-01-28 조회 3,516
12-01-28 조회 2,750
12-01-28 조회 3,564
12-01-27 조회 2,953
12-01-27 조회 2,866
12-01-27 조회 2,911
12-01-27 조회 3,358
12-01-26 조회 6,652
12-01-26 조회 3,713
12-01-26 조회 3,496
12-01-26 조회 3,029
12-01-26 조회 3,126
12-01-25 조회 3,200
12-01-25 조회 3,005
12-01-25 조회 2,874
12-01-25 조회 2,681
12-01-25 조회 2,549
12-01-25 조회 4,283
12-01-25 조회 4,150
12-01-25 조회 2,757
12-01-25 조회 4,115
12-01-25 조회 3,590
12-01-24 조회 3,304
12-01-24 조회 3,509
12-01-24 조회 3,724
12-01-24 조회 4,436
12-01-22 조회 3,521
12-01-22 조회 2,866
12-01-22 조회 3,276
12-01-22 조회 3,773
12-01-21 조회 3,123