t

Loading Panel Widget

· 14년 전 · 1159

                                     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();
    }
};


|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
14년 전 조회 2,059
14년 전 조회 1,064
14년 전 조회 978
14년 전 조회 721
14년 전 조회 972
14년 전 조회 1,987
14년 전 조회 544
14년 전 조회 2,512
14년 전 조회 888
14년 전 조회 586
14년 전 조회 591
14년 전 조회 851
14년 전 조회 767
14년 전 조회 672
14년 전 조회 1,143
14년 전 조회 585
14년 전 조회 1,256
14년 전 조회 1,624
14년 전 조회 602
14년 전 조회 725
14년 전 조회 565
14년 전 조회 723
14년 전 조회 1,160
14년 전 조회 854
14년 전 조회 978
14년 전 조회 794
14년 전 조회 939
14년 전 조회 532
14년 전 조회 1,346
14년 전 조회 693
14년 전 조회 1,451
14년 전 조회 8,187
14년 전 조회 822
14년 전 조회 1,654
14년 전 조회 1,385
14년 전 조회 1,660
14년 전 조회 1,998
14년 전 조회 600
14년 전 조회 741
14년 전 조회 6,526
14년 전 조회 720
14년 전 조회 661
14년 전 조회 1,814
14년 전 조회 708
14년 전 조회 709
14년 전 조회 2,176
14년 전 조회 780
14년 전 조회 3,681
14년 전 조회 3,802
14년 전 조회 1,160
14년 전 조회 747
14년 전 조회 1,424
14년 전 조회 672
14년 전 조회 1,001
14년 전 조회 580
14년 전 조회 7,406
14년 전 조회 1,081
14년 전 조회 494
14년 전 조회 656
14년 전 조회 1,365
14년 전 조회 799
14년 전 조회 632
14년 전 조회 752
14년 전 조회 691
14년 전 조회 492
14년 전 조회 665
14년 전 조회 661
14년 전 조회 638
14년 전 조회 693
14년 전 조회 944
14년 전 조회 960
14년 전 조회 1,184
14년 전 조회 839
14년 전 조회 760
14년 전 조회 632
14년 전 조회 604
14년 전 조회 597
14년 전 조회 760
14년 전 조회 1,994
14년 전 조회 647
14년 전 조회 959
14년 전 조회 2,137
14년 전 조회 1,238
14년 전 조회 1,009
14년 전 조회 4,747
14년 전 조회 1,957
14년 전 조회 811
14년 전 조회 686
14년 전 조회 645
14년 전 조회 530
14년 전 조회 1,798
14년 전 조회 3,122
14년 전 조회 623
14년 전 조회 814
14년 전 조회 1,790
14년 전 조회 659
14년 전 조회 1,314
14년 전 조회 1,657
14년 전 조회 1만
14년 전 조회 1,182