Extjs3 主题样式
1、 主题设置
引入相应的样式
<!-- Theme includes -->
<link rel="stylesheet" type="text/css" title="blue" href="../../resources/css/xtheme-blue.css" />
<link rel="stylesheet" type="text/css" title="gray" href="../../resources/css/xtheme-gray.css" />//只要在这里添加好所属主题的样式就可以了
<link rel="stylesheet" type="text/css" title="access" href="../../resources/css/xtheme-access.css" />
<link rel="stylesheet" type="text/css" title="yourtheme" href="../../resources/css/yourtheme.css" />
如果想自动切换,用js实现
function setActiveStyleSheet(title) {
var i,
a,
links = document.getElementsByTagName("link"),
len = links.length;
for (i = 0; i < len; i++) {
a = links[i];
if (a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if (a.getAttribute("title") == title) a.disabled = false;//title为id=title的下拉框
}
}
}