t

Loading Panel Widget

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

                                     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건
+
제목 글쓴이 날짜 조회
11-12-23 조회 4,102
11-12-23 조회 3,044
11-12-23 조회 4,871
11-12-23 조회 4,444
11-12-23 조회 2,798
11-12-23 조회 8,127
11-12-22 조회 3,120
11-12-22 조회 3,857
11-12-22 조회 3,613
11-12-22 조회 3,520
11-12-22 조회 3,716
11-12-21 조회 3,566
11-12-21 조회 3,342
11-12-21 조회 3,639
11-12-21 조회 4,029
11-12-21 조회 3,053
11-12-21 조회 3,554
11-12-21 조회 4,482
11-12-21 조회 4,300
11-12-21 조회 3,331
11-12-20 조회 3,798
11-12-19 조회 6,300
11-12-19 조회 2,975
11-12-19 조회 5,054
11-12-17 조회 3,907
11-12-17 조회 4,283
11-12-17 조회 3,575
11-12-16 조회 3,177
11-12-16 조회 3,338
11-12-15 조회 3,391
11-12-15 조회 3,501
11-12-15 조회 4,310
11-12-15 조회 5,609
11-12-15 조회 4,595
11-12-15 조회 3,267
11-12-15 조회 4,037
11-12-15 조회 4,211
11-12-14 조회 2,967
11-12-14 조회 4,395
11-12-14 조회 5,642
11-12-13 조회 4,203
11-12-13 조회 5,098
11-12-13 조회 6,118
11-12-13 조회 6,408
11-12-13 조회 4,814
11-12-12 조회 3,317
11-12-12 조회 3,623
11-12-12 조회 6,295
11-12-12 조회 4,689
11-12-12 조회 3,822
11-12-12 조회 6,187
11-12-11 조회 4,707
11-12-10 조회 2,823
11-12-10 조회 4,767
11-12-09 조회 2,869
11-12-09 조회 3,275
11-12-09 조회 4,201
11-12-09 조회 3,814
11-12-09 조회 4,022
11-12-09 조회 3,567
11-12-09 조회 4,525
11-12-09 조회 3,206
11-12-09 조회 3,352
11-12-09 조회 3,030
11-12-09 조회 3,846
11-12-08 조회 3,616
11-12-08 조회 3,565
11-12-08 조회 7,882
11-12-08 조회 4,187
11-12-08 조회 3,677
11-12-08 조회 2,921
11-12-08 조회 1.2만
11-12-08 조회 4,005
11-12-07 조회 2,875
11-12-07 조회 2,912
11-12-07 조회 3,955
11-12-07 조회 4,554
11-12-07 조회 4,020
11-12-07 조회 3,114
11-12-07 조회 4,441
11-12-06 조회 4,345
11-12-06 조회 5,687
11-12-06 조회 3,744
11-12-06 조회 3,675
11-12-05 조회 3,093
11-12-05 조회 3,388
11-12-05 조회 4,620
11-12-05 조회 3,366
11-12-05 조회 4,978
11-12-05 조회 2,928
11-12-05 조회 6,002
11-12-05 조회 3,125
11-12-05 조회 4,454
11-12-04 조회 5,771
11-12-04 조회 3,016
11-12-04 조회 3,380
11-12-03 조회 3,692
11-12-03 조회 3,054
11-12-03 조회 3,647
11-12-03 조회 3,551