easyui tabs内容panel自适应窗体宽度方法


废话不说,直接上代码:

$('#Teacherwin_details').window({
                    title: '查看教职工信息',
                    width: 800,
                    height: 520,
                    top: ($(window).height() - 720) * 0.5,
                    left: ($(window).width() - 800) * 0.5,
                    modal: true,
                    onResize: function (width,height) {
                        var stab = $('#Teacher_tab').tabs('getSelected');
                        var actWidth = width; if (width > 38) { actWidth = width - 38; }
                        stab.width(actWidth);
                    }
                }).window('open');
                $('#Teacherfm_details').form('load', row);
                $('#Teacher_tab').tabs('select', 0);

 注意:代码中的38是这样得到的:在默认情况下,窗体的宽度为800,而监视stab时发现stab的宽度为762,因此,stab与窗体之间有38个像素的间隙。写代码时,也可以直接用变量代替38,使代码更直观,更优雅。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM