当前位置: 代码迷 >> ASP.NET >> 一段JQ代码有关问题
  详细解决方案

一段JQ代码有关问题

热度:5642   发布时间:2013-02-25 00:00:00.0
一段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" />')('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" />')('The JerichoTab processed in ' + (new Date().getTime() - d1) + ' milliseconds!').appendTo(h);
}
}
],
activeTabIndex: 0,
loadOnce: true
});
}
}
  相关解决方案