初次导入样式:
通过如下函数,即可实现动态更换CSS效果
<link rel="stylesheet" type="text/css" id="uiCss" media="screen" href="${ctx}/css/themes/black-tie/jquery-ui.css" />
通过如下函数,即可实现动态更换CSS效果
function loadCss(file){
var cssTag = document.getElementById('uiCss');
var head = document.getElementsByTagName('head').item(0);
if(cssTag) head.removeChild(cssTag);
css = document.createElement('link');
css.href = "//code.jquery.com/ui/1.10.3/themes/"+file+"/jquery-ui.css";
css.rel = 'stylesheet';
css.type = 'text/css';
css.id = 'uiCss';
head.appendChild(css);
}