t

Loading Panel Widget

· 14년 전 · 1098

                                     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년 전 조회 1,980
14년 전 조회 999
14년 전 조회 904
14년 전 조회 651
14년 전 조회 896
14년 전 조회 1,911
14년 전 조회 479
14년 전 조회 2,439
14년 전 조회 806
14년 전 조회 514
14년 전 조회 518
14년 전 조회 782
14년 전 조회 686
14년 전 조회 584
14년 전 조회 1,074
14년 전 조회 510
14년 전 조회 1,192
14년 전 조회 1,557
14년 전 조회 524
14년 전 조회 651
14년 전 조회 506
14년 전 조회 655
14년 전 조회 1,085
14년 전 조회 781
14년 전 조회 902
14년 전 조회 725
14년 전 조회 868
14년 전 조회 461
14년 전 조회 1,272
14년 전 조회 616
14년 전 조회 1,373
14년 전 조회 8,129
14년 전 조회 753
14년 전 조회 1,596
14년 전 조회 1,318
14년 전 조회 1,594
14년 전 조회 1,932
14년 전 조회 530
14년 전 조회 667
14년 전 조회 6,462
14년 전 조회 656
14년 전 조회 589
14년 전 조회 1,739
14년 전 조회 641
14년 전 조회 641
14년 전 조회 2,106
14년 전 조회 707
14년 전 조회 3,615
14년 전 조회 3,738
14년 전 조회 1,099
14년 전 조회 677
14년 전 조회 1,357
14년 전 조회 606
14년 전 조회 928
14년 전 조회 517
14년 전 조회 7,333
14년 전 조회 1,018
14년 전 조회 429
14년 전 조회 594
14년 전 조회 1,296
14년 전 조회 728
14년 전 조회 562
14년 전 조회 685
14년 전 조회 617
14년 전 조회 425
14년 전 조회 591
14년 전 조회 576
14년 전 조회 558
14년 전 조회 630
14년 전 조회 872
14년 전 조회 884
14년 전 조회 1,116
14년 전 조회 776
14년 전 조회 696
14년 전 조회 572
14년 전 조회 544
14년 전 조회 529
14년 전 조회 710
14년 전 조회 1,932
14년 전 조회 581
14년 전 조회 903
14년 전 조회 2,068
14년 전 조회 1,173
14년 전 조회 946
14년 전 조회 4,686
14년 전 조회 1,892
14년 전 조회 749
14년 전 조회 618
14년 전 조회 578
14년 전 조회 469
14년 전 조회 1,739
14년 전 조회 3,062
14년 전 조회 557
14년 전 조회 747
14년 전 조회 1,729
14년 전 조회 591
14년 전 조회 1,248
14년 전 조회 1,591
14년 전 조회 1만
14년 전 조회 1,119
🐛 버그신고