t

Loading Panel Widget

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

                                     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,476
11-11-15 조회 2,582
11-11-15 조회 3,198
11-11-15 조회 2,647
11-11-14 조회 2,741
11-11-14 조회 3,698
11-11-14 조회 3,491
11-11-14 조회 4,176
11-11-14 조회 2,782
11-11-14 조회 2,693
11-11-13 조회 3,985
11-11-12 조회 2,627
11-11-12 조회 2,749
11-11-12 조회 3,976
11-11-11 조회 2,884
11-11-11 조회 2,828
11-11-11 조회 2,505
11-11-11 조회 2,819
11-11-11 조회 3,952
11-11-11 조회 2,419
11-11-11 조회 4,656
11-11-11 조회 2,694
11-11-11 조회 2,518
11-11-11 조회 2,387
11-11-11 조회 2,805
11-11-11 조회 2,592
11-11-11 조회 2,583
11-11-10 조회 3,011
11-11-10 조회 2,485
11-11-10 조회 3,121
11-11-10 조회 3,679
11-11-10 조회 2,381
11-11-10 조회 2,515
11-11-10 조회 2,341
11-11-09 조회 2,532
11-11-09 조회 3,225
11-11-09 조회 2,718
11-11-09 조회 2,863
11-11-08 조회 2,620
11-11-08 조회 2,944
11-11-08 조회 2,278
11-11-08 조회 3,233
11-11-08 조회 2,524
11-11-08 조회 3,304
11-11-06 조회 1만
11-11-06 조회 2,586
11-11-06 조회 3,577
11-11-06 조회 3,388
11-11-06 조회 3,696
11-11-06 조회 3,885
11-11-05 조회 2,425
11-11-05 조회 2,592
11-11-04 조회 8,486
11-11-04 조회 2,541
11-11-04 조회 2,600
11-11-04 조회 3,606
11-11-04 조회 2,499
11-11-04 조회 2,670
11-11-03 조회 3,933
11-11-03 조회 2,603
11-11-03 조회 5,570
11-11-02 조회 5,842
11-11-01 조회 3,123
11-11-01 조회 2,562
11-11-01 조회 3,177
11-11-01 조회 2,470
11-11-01 조회 2,805
11-11-01 조회 2,325
11-11-01 조회 9,352
11-11-01 조회 2,915
11-10-31 조회 2,303
11-10-27 조회 2,554
11-10-26 조회 3,150
11-10-26 조회 2,637
11-10-26 조회 2,498
11-10-26 조회 2,524
11-10-26 조회 2,412
11-10-25 조회 2,466
11-10-25 조회 2,554
11-10-25 조회 2,499
11-10-25 조회 2,478
11-10-24 조회 2,518
11-10-24 조회 2,779
11-10-24 조회 2,792
11-10-23 조회 3,155
11-10-23 조회 2,744
11-10-23 조회 2,632
11-10-21 조회 2,490
11-10-21 조회 2,419
11-10-21 조회 2,400
11-10-21 조회 2,783
11-10-20 조회 3,977
11-10-19 조회 2,460
11-10-19 조회 2,852
11-10-19 조회 3,974
11-10-19 조회 3,118
11-10-19 조회 2,834
11-10-19 조회 6,657
11-10-18 조회 3,992
11-10-18 조회 2,565