世间自有公道,付出总有回报,说到不如做到,要做就做好,步步高!

easyui layout 折叠后显示标题

(function($){
 var buttonDir = {north:'down',south:'up',east:'left',west:'right'};
    $.extend($.fn.layout.paneldefaults,{
        onBeforeCollapse:function(){
            /**/
            var popts = $(this).panel('options');
            var dir = popts.region;
            var btnDir = buttonDir[dir];
            if(!btnDir) return false;

            setTimeout(function(){
                var pDiv = $('.layout-button-'+btnDir).closest('.layout-expand').css({
                    textAlign:'center',lineHeight:'18px',fontWeight:'bold'
                });

                if(popts.title){
                    var vTitle = popts.title;
                    if(dir == "east" || dir == "west"){
                        var vTitle = popts.title.split('').join('<br/>');
                        pDiv.find('.panel-body').html(vTitle);
                    }else{
                        $('.layout-button-'+btnDir).closest('.layout-expand').find('.panel-title')
                        .css({textAlign:'left'})
                        .html(vTitle)
                    }
                    
                }    
            },100);
            
        }
    });
})(jQuery);

  

posted @ 2014-10-13 14:53  疯狂秀才  阅读(6770)  评论(0编辑  收藏  举报