t

Loading Panel Widget

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

                                     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,412
11-11-15 조회 2,538
11-11-15 조회 3,164
11-11-15 조회 2,604
11-11-14 조회 2,686
11-11-14 조회 3,637
11-11-14 조회 3,431
11-11-14 조회 4,104
11-11-14 조회 2,726
11-11-14 조회 2,654
11-11-13 조회 3,956
11-11-12 조회 2,600
11-11-12 조회 2,720
11-11-12 조회 3,926
11-11-11 조회 2,843
11-11-11 조회 2,796
11-11-11 조회 2,483
11-11-11 조회 2,797
11-11-11 조회 3,932
11-11-11 조회 2,399
11-11-11 조회 4,620
11-11-11 조회 2,666
11-11-11 조회 2,491
11-11-11 조회 2,353
11-11-11 조회 2,761
11-11-11 조회 2,553
11-11-11 조회 2,546
11-11-10 조회 2,962
11-11-10 조회 2,392
11-11-10 조회 3,079
11-11-10 조회 3,628
11-11-10 조회 2,333
11-11-10 조회 2,458
11-11-10 조회 2,307
11-11-09 조회 2,491
11-11-09 조회 3,172
11-11-09 조회 2,674
11-11-09 조회 2,819
11-11-08 조회 2,582
11-11-08 조회 2,904
11-11-08 조회 2,248
11-11-08 조회 3,183
11-11-08 조회 2,469
11-11-08 조회 3,244
11-11-06 조회 1만
11-11-06 조회 2,557
11-11-06 조회 3,552
11-11-06 조회 3,347
11-11-06 조회 3,638
11-11-06 조회 3,817
11-11-05 조회 2,358
11-11-05 조회 2,522
11-11-04 조회 8,362
11-11-04 조회 2,488
11-11-04 조회 2,544
11-11-04 조회 3,547
11-11-04 조회 2,447
11-11-04 조회 2,623
11-11-03 조회 3,885
11-11-03 조회 2,550
11-11-03 조회 5,516
11-11-02 조회 5,779
11-11-01 조회 2,994
11-11-01 조회 2,492
11-11-01 조회 3,129
11-11-01 조회 2,440
11-11-01 조회 2,772
11-11-01 조회 2,291
11-11-01 조회 9,301
11-11-01 조회 2,854
11-10-31 조회 2,247
11-10-27 조회 2,474
11-10-26 조회 3,103
11-10-26 조회 2,583
11-10-26 조회 2,437
11-10-26 조회 2,482
11-10-26 조회 2,374
11-10-25 조회 2,353
11-10-25 조회 2,465
11-10-25 조회 2,441
11-10-25 조회 2,419
11-10-24 조회 2,463
11-10-24 조회 2,723
11-10-24 조회 2,731
11-10-23 조회 3,072
11-10-23 조회 2,659
11-10-23 조회 2,579
11-10-21 조회 2,449
11-10-21 조회 2,381
11-10-21 조회 2,351
11-10-21 조회 2,644
11-10-20 조회 3,888
11-10-19 조회 2,401
11-10-19 조회 2,783
11-10-19 조회 3,897
11-10-19 조회 3,050
11-10-19 조회 2,759
11-10-19 조회 6,576
11-10-18 조회 3,877
11-10-18 조회 2,509