日期:2014-05-18  浏览次数:20543 次

一段JQ代码问题
由于以前没用过JQ,刚遇到条JQ代码
JScript code

 buildTabpanel: function() {
                $.fn.initJerichoTab({
                    renderTo: '.divRight',
                    uniqueId: 'myJerichoTab',
                    [color=#FF0000]contentCss: { 'height': $('.divRight').height() - 25 },[/color]                    tabs: [{
                    title: '首页',
                        closeable: true,
                        iconImg: 'images/jerichotab.png',
                        data: { dataType: 'iframe', dataLink: 'Desktop.aspx' },
                        onLoadCompleted: function(h) {
                            $('<b style="color:red" />').html('The JerichoTab processed in ' + (new Date().getTime() - d1) + ' milliseconds!').appendTo(h);
                        }
                    }
                           ],
                    activeTabIndex: 0,
                    loadOnce: true
                });
            }
        }



红字contentCss: { 'height': $('.divRight').height() - 25 },为给divRight加个高度的样式,现在我在其后面加上
contentCss: { 'background':‘White’ },
运行后,divRight只出背景颜色,不出高度。然后我将contentCss: { 'height': $('.divRight').height() - 25 },放到最下面,运行后代码只出高度,不出背景色。
因为不知道JQ的原理,所以想问问如何写才能2个样式都显示出来

------解决方案--------------------
contentCss: { 'height': $('.divRight').height() - 25,'background':'white' },
这样写试试看,原本jq的css方法就支持这么写的
------解决方案--------------------

Jquery Tabpanel???

试试。。。。

buildTabpanel: function() {
$.fn.initJerichoTab({
renderTo: '.divRight',
uniqueId: 'myJerichoTab',
contentCss: { 'background':‘White’ },
height: $('.divRight').height() - 25 ,
tabs: [{
title: '首页',
closeable: true,
iconImg: 'images/jerichotab.png',
data: { dataType: 'iframe', dataLink: 'Desktop.aspx' },
onLoadCompleted: function(h) {
$('<b style="color:red" />').html('The JerichoTab processed in ' + (new Date().getTime() - d1) + ' milliseconds!').appendTo(h);
}
}
],
activeTabIndex: 0,
loadOnce: true
});
}
}