t

Loading Panel Widget

· 14년 전 · 1096

                                     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,978
14년 전 조회 993
14년 전 조회 902
14년 전 조회 647
14년 전 조회 892
14년 전 조회 1,910
14년 전 조회 477
14년 전 조회 2,438
14년 전 조회 806
14년 전 조회 512
14년 전 조회 516
14년 전 조회 780
14년 전 조회 684
14년 전 조회 584
14년 전 조회 1,071
14년 전 조회 509
14년 전 조회 1,187
14년 전 조회 1,557
14년 전 조회 522
14년 전 조회 650
14년 전 조회 503
14년 전 조회 655
14년 전 조회 1,083
14년 전 조회 779
14년 전 조회 901
14년 전 조회 725
14년 전 조회 866
14년 전 조회 459
14년 전 조회 1,269
14년 전 조회 614
14년 전 조회 1,373
14년 전 조회 8,126
14년 전 조회 750
14년 전 조회 1,591
14년 전 조회 1,315
14년 전 조회 1,590
14년 전 조회 1,929
14년 전 조회 525
14년 전 조회 666
14년 전 조회 6,461
14년 전 조회 654
14년 전 조회 587
14년 전 조회 1,738
14년 전 조회 641
14년 전 조회 639
14년 전 조회 2,106
14년 전 조회 704
14년 전 조회 3,613
14년 전 조회 3,736
14년 전 조회 1,097
14년 전 조회 676
14년 전 조회 1,353
14년 전 조회 603
14년 전 조회 924
14년 전 조회 514
14년 전 조회 7,333
14년 전 조회 1,018
14년 전 조회 428
14년 전 조회 594
14년 전 조회 1,293
14년 전 조회 728
14년 전 조회 562
14년 전 조회 681
14년 전 조회 616
14년 전 조회 425
14년 전 조회 591
14년 전 조회 573
14년 전 조회 556
14년 전 조회 627
14년 전 조회 872
14년 전 조회 884
14년 전 조회 1,113
14년 전 조회 776
14년 전 조회 695
14년 전 조회 571
14년 전 조회 541
14년 전 조회 529
14년 전 조회 710
14년 전 조회 1,931
14년 전 조회 578
14년 전 조회 902
14년 전 조회 2,067
14년 전 조회 1,172
14년 전 조회 946
14년 전 조회 4,686
14년 전 조회 1,892
14년 전 조회 748
14년 전 조회 617
14년 전 조회 578
14년 전 조회 469
14년 전 조회 1,739
14년 전 조회 3,061
14년 전 조회 555
14년 전 조회 746
14년 전 조회 1,728
14년 전 조회 591
14년 전 조회 1,247
14년 전 조회 1,589
14년 전 조회 1만
14년 전 조회 1,119
🐛 버그신고