t

Loading Panel Widget

· 2011-11-01 (화) 17:47:24 · 3220

                                     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();
    }
};


댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,187건
+
제목 글쓴이 날짜 조회
11-10-18 조회 2,645
11-10-18 조회 2,563
11-10-18 조회 2,479
11-10-17 조회 3,850
11-10-17 조회 5,130
11-10-17 조회 2,480
11-10-17 조회 2,746
11-10-17 조회 3,843
11-10-16 조회 2,514
11-10-16 조회 3,160
11-10-16 조회 3,602
11-10-15 조회 1.2만
11-10-15 조회 3,277
11-10-15 조회 3,018
11-10-15 조회 3,700
11-10-15 조회 3,683
11-10-15 조회 2,931
11-10-14 조회 2,954
11-10-13 조회 2,715
11-10-13 조회 4,495
11-10-12 조회 2,518
11-10-12 조회 2,682
11-10-12 조회 3,792
11-10-12 조회 4,088
11-10-12 조회 2,430
11-10-11 조회 2,950
11-10-11 조회 2,601
11-10-11 조회 2,778
11-10-11 조회 3,090
11-10-10 조회 2,752
11-10-10 조회 2,729
11-10-10 조회 2,438
11-10-10 조회 2,430
11-10-10 조회 2,708
11-10-10 조회 2,827
11-10-09 조회 2,634
11-10-08 조회 2,627
11-10-08 조회 4,559
11-10-08 조회 2,911
11-10-07 조회 3,124
11-10-07 조회 2,962
11-10-07 조회 3,458
11-10-06 조회 4,047
11-10-06 조회 2,610
11-10-06 조회 2,701
11-10-06 조회 3,910
11-10-06 조회 2,755
11-10-06 조회 4,295
11-10-06 조회 2,524
11-10-05 조회 2,805
11-10-05 조회 2,946
11-10-05 조회 4,041
11-10-04 조회 2,925
11-10-04 조회 5,369
11-10-04 조회 2,833
11-10-04 조회 2,380
11-10-03 조회 2,763
11-10-02 조회 2,648
11-10-02 조회 3,372
11-10-01 조회 2,404
11-10-01 조회 2,719
11-09-30 조회 2,608
11-09-30 조회 2,707
11-09-30 조회 2,890
11-09-30 조회 2,893
11-09-30 조회 3,663
11-09-30 조회 2,666
11-09-30 조회 3,097
11-09-29 조회 4,921
11-09-29 조회 2,750
11-09-29 조회 2,647
11-09-29 조회 3,057
11-09-28 조회 3,159
11-09-28 조회 3,931
11-09-28 조회 3,134
11-09-28 조회 2,510
11-09-28 조회 2,453
11-09-28 조회 2,322
11-09-28 조회 2,618
11-09-28 조회 4,121
11-09-26 조회 2,537
11-09-26 조회 2,603
11-09-26 조회 2,722
11-09-25 조회 3,067
11-09-24 조회 2,544
11-09-23 조회 2,824
11-09-23 조회 3,415
11-09-23 조회 2,544
11-09-23 조회 2,947
11-09-23 조회 2,287
11-09-22 조회 2,461
11-09-22 조회 2,871
11-09-21 조회 3,241
11-09-21 조회 3,266
11-09-20 조회 2,833
11-09-20 조회 2,661
11-09-20 조회 3,181
11-09-19 조회 2,704
11-09-19 조회 5,997
11-09-19 조회 3,796