t

Loading Panel Widget

· 14년 전 · 1127

                                     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,033
14년 전 조회 1,044
14년 전 조회 952
14년 전 조회 704
14년 전 조회 949
14년 전 조회 1,957
14년 전 조회 526
14년 전 조회 2,489
14년 전 조회 860
14년 전 조회 557
14년 전 조회 565
14년 전 조회 828
14년 전 조회 739
14년 전 조회 634
14년 전 조회 1,118
14년 전 조회 557
14년 전 조회 1,235
14년 전 조회 1,599
14년 전 조회 569
14년 전 조회 703
14년 전 조회 545
14년 전 조회 699
14년 전 조회 1,135
14년 전 조회 825
14년 전 조회 940
14년 전 조회 764
14년 전 조회 916
14년 전 조회 504
14년 전 조회 1,317
14년 전 조회 670
14년 전 조회 1,418
14년 전 조회 8,164
14년 전 조회 798
14년 전 조회 1,633
14년 전 조회 1,356
14년 전 조회 1,638
14년 전 조회 1,972
14년 전 조회 577
14년 전 조회 716
14년 전 조회 6,504
14년 전 조회 697
14년 전 조회 636
14년 전 조회 1,785
14년 전 조회 692
14년 전 조회 685
14년 전 조회 2,153
14년 전 조회 755
14년 전 조회 3,655
14년 전 조회 3,776
14년 전 조회 1,128
14년 전 조회 722
14년 전 조회 1,402
14년 전 조회 647
14년 전 조회 972
14년 전 조회 554
14년 전 조회 7,380
14년 전 조회 1,055
14년 전 조회 477
14년 전 조회 628
14년 전 조회 1,336
14년 전 조회 768
14년 전 조회 608
14년 전 조회 733
14년 전 조회 658
14년 전 조회 468
14년 전 조회 640
14년 전 조회 623
14년 전 조회 605
14년 전 조회 666
14년 전 조회 916
14년 전 조회 927
14년 전 조회 1,155
14년 전 조회 812
14년 전 조회 739
14년 전 조회 614
14년 전 조회 577
14년 전 조회 572
14년 전 조회 737
14년 전 조회 1,969
14년 전 조회 625
14년 전 조회 939
14년 전 조회 2,113
14년 전 조회 1,214
14년 전 조회 983
14년 전 조회 4,719
14년 전 조회 1,928
14년 전 조회 790
14년 전 조회 661
14년 전 조회 619
14년 전 조회 507
14년 전 조회 1,772
14년 전 조회 3,099
14년 전 조회 598
14년 전 조회 788
14년 전 조회 1,763
14년 전 조회 631
14년 전 조회 1,289
14년 전 조회 1,630
14년 전 조회 1만
14년 전 조회 1,157
🐛 버그신고