t

Loading Panel Widget

· 14년 전 · 1203

                                     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,086
14년 전 조회 1,076
14년 전 조회 1,013
14년 전 조회 753
14년 전 조회 1,006
14년 전 조회 2,008
14년 전 조회 588
14년 전 조회 2,557
14년 전 조회 926
14년 전 조회 616
14년 전 조회 617
14년 전 조회 882
14년 전 조회 789
14년 전 조회 699
14년 전 조회 1,173
14년 전 조회 631
14년 전 조회 1,282
14년 전 조회 1,662
14년 전 조회 632
14년 전 조회 766
14년 전 조회 602
14년 전 조회 753
14년 전 조회 1,194
14년 전 조회 898
14년 전 조회 1,006
14년 전 조회 831
14년 전 조회 978
14년 전 조회 565
14년 전 조회 1,375
14년 전 조회 720
14년 전 조회 1,481
14년 전 조회 8,227
14년 전 조회 847
14년 전 조회 1,687
14년 전 조회 1,423
14년 전 조회 1,688
14년 전 조회 2,021
14년 전 조회 638
14년 전 조회 772
14년 전 조회 6,562
14년 전 조회 757
14년 전 조회 688
14년 전 조회 1,847
14년 전 조회 736
14년 전 조회 735
14년 전 조회 2,216
14년 전 조회 808
14년 전 조회 3,726
14년 전 조회 3,844
14년 전 조회 1,204
14년 전 조회 781
14년 전 조회 1,453
14년 전 조회 703
14년 전 조회 1,032
14년 전 조회 606
14년 전 조회 7,438
14년 전 조회 1,127
14년 전 조회 528
14년 전 조회 693
14년 전 조회 1,396
14년 전 조회 829
14년 전 조회 676
14년 전 조회 782
14년 전 조회 733
14년 전 조회 546
14년 전 조회 707
14년 전 조회 684
14년 전 조회 668
14년 전 조회 722
14년 전 조회 975
14년 전 조회 1,002
14년 전 조회 1,216
14년 전 조회 879
14년 전 조회 784
14년 전 조회 677
14년 전 조회 636
14년 전 조회 639
14년 전 조회 807
14년 전 조회 2,042
14년 전 조회 676
14년 전 조회 1,004
14년 전 조회 2,168
14년 전 조회 1,283
14년 전 조회 1,055
14년 전 조회 4,786
14년 전 조회 1,996
14년 전 조회 834
14년 전 조회 723
14년 전 조회 682
14년 전 조회 568
14년 전 조회 1,839
14년 전 조회 3,156
14년 전 조회 653
14년 전 조회 850
14년 전 조회 1,834
14년 전 조회 701
14년 전 조회 1,355
14년 전 조회 1,693
14년 전 조회 1만
14년 전 조회 1,212