t

Loading Panel Widget

· 14년 전 · 1220

                                     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,097
14년 전 조회 1,092
14년 전 조회 1,027
14년 전 조회 766
14년 전 조회 1,019
14년 전 조회 2,023
14년 전 조회 605
14년 전 조회 2,577
14년 전 조회 938
14년 전 조회 636
14년 전 조회 632
14년 전 조회 896
14년 전 조회 804
14년 전 조회 716
14년 전 조회 1,194
14년 전 조회 647
14년 전 조회 1,287
14년 전 조회 1,678
14년 전 조회 651
14년 전 조회 784
14년 전 조회 616
14년 전 조회 770
14년 전 조회 1,210
14년 전 조회 913
14년 전 조회 1,019
14년 전 조회 843
14년 전 조회 987
14년 전 조회 579
14년 전 조회 1,393
14년 전 조회 742
14년 전 조회 1,503
14년 전 조회 8,239
14년 전 조회 863
14년 전 조회 1,709
14년 전 조회 1,435
14년 전 조회 1,700
14년 전 조회 2,030
14년 전 조회 655
14년 전 조회 786
14년 전 조회 6,580
14년 전 조회 769
14년 전 조회 699
14년 전 조회 1,854
14년 전 조회 754
14년 전 조회 752
14년 전 조회 2,232
14년 전 조회 827
14년 전 조회 3,739
14년 전 조회 3,862
14년 전 조회 1,221
14년 전 조회 797
14년 전 조회 1,465
14년 전 조회 721
14년 전 조회 1,051
14년 전 조회 620
14년 전 조회 7,454
14년 전 조회 1,143
14년 전 조회 542
14년 전 조회 708
14년 전 조회 1,408
14년 전 조회 845
14년 전 조회 689
14년 전 조회 800
14년 전 조회 746
14년 전 조회 567
14년 전 조회 722
14년 전 조회 699
14년 전 조회 680
14년 전 조회 745
14년 전 조회 992
14년 전 조회 1,017
14년 전 조회 1,231
14년 전 조회 898
14년 전 조회 798
14년 전 조회 692
14년 전 조회 653
14년 전 조회 655
14년 전 조회 827
14년 전 조회 2,062
14년 전 조회 690
14년 전 조회 1,016
14년 전 조회 2,187
14년 전 조회 1,303
14년 전 조회 1,074
14년 전 조회 4,801
14년 전 조회 2,020
14년 전 조회 847
14년 전 조회 737
14년 전 조회 698
14년 전 조회 585
14년 전 조회 1,855
14년 전 조회 3,170
14년 전 조회 667
14년 전 조회 869
14년 전 조회 1,847
14년 전 조회 713
14년 전 조회 1,366
14년 전 조회 1,705
14년 전 조회 1만
14년 전 조회 1,227