t

Loading Panel Widget

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

                                     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건
+
제목 글쓴이 날짜 조회
12-01-22 조회 3,622
12-01-21 조회 2,973
12-01-19 조회 4,839
12-01-18 조회 2,854
12-01-18 조회 2,811
12-01-18 조회 3,013
12-01-17 조회 2,793
12-01-17 조회 3,056
12-01-14 조회 1.1만
12-01-14 조회 3,593
12-01-14 조회 3,907
12-01-11 조회 3,357
12-01-11 조회 3,088
12-01-11 조회 3,092
12-01-11 조회 3,206
12-01-11 조회 3,419
12-01-11 조회 2,729
12-01-10 조회 3,044
12-01-10 조회 2,826
12-01-10 조회 2,853
12-01-09 조회 2,851
12-01-08 조회 2,948
12-01-07 조회 2,888
12-01-06 조회 2,660
12-01-06 조회 2,786
12-01-05 조회 2,788
12-01-02 조회 2,933
11-12-29 조회 2,907
11-12-28 조회 2,891
11-12-28 조회 2,808
11-12-27 조회 3,021
11-12-23 조회 2,758
11-12-23 조회 2,900
11-12-21 조회 3,892
11-12-21 조회 2,933
11-12-19 조회 2,845
11-12-14 조회 4,254
11-12-08 조회 3,395
11-12-08 조회 4,064
11-12-07 조회 4,341
11-12-06 조회 4,246
11-12-06 조회 3,625
11-12-05 조회 3,266
11-12-05 조회 4,860
11-12-04 조회 3,265
11-12-03 조회 3,571
11-12-02 조회 3,483
11-12-02 조회 3,474
11-12-02 조회 2,807
11-12-01 조회 2,787
11-12-01 조회 3,687
11-12-01 조회 2,770
11-11-29 조회 5,644
11-11-23 조회 3,581
11-11-23 조회 3,932
11-11-22 조회 3,905
11-11-22 조회 2,969
11-11-21 조회 3,500
11-11-21 조회 2,801
11-11-18 조회 3,902
11-11-18 조회 3,050
11-11-17 조회 2,942
11-11-17 조회 2,954
11-11-17 조회 4,524
11-11-11 조회 2,817
11-11-11 조회 2,809
11-11-11 조회 3,943
11-11-11 조회 4,646
11-11-08 조회 2,929
11-11-06 조회 3,370
11-11-06 조회 3,675
11-10-21 조회 2,474
11-10-21 조회 2,376
11-10-19 조회 2,444
11-10-19 조회 3,954
11-10-08 조회 2,489
11-10-06 조회 4,174
11-10-01 조회 2,591
11-09-30 조회 2,560
11-09-29 조회 2,558
11-09-26 조회 2,419
11-09-23 조회 2,418
11-09-23 조회 2,179
11-09-22 조회 2,767
11-09-09 조회 3,072
11-08-30 조회 4,042
11-08-23 조회 2,207
11-08-12 조회 2,378
11-08-04 조회 3,962
11-07-01 조회 2,940
11-06-09 조회 2,579
11-05-17 조회 2,695
11-05-07 조회 2,957
11-04-21 조회 2,626
11-04-12 조회 2,489
11-04-11 조회 3,583
11-02-11 조회 2,710
11-02-08 조회 2,177
11-01-11 조회 2,549
10-11-26 조회 3,893