我想在用户使用jQuery UI Themeselector更改页面主题时更改主体背景颜色。如何通过ThemeSelector更改背景颜色以匹配jQuery UI主题?
我已经试过这
function updateBodyBackground() {
$("body").css('background-color', $('.ui-widget-header:first").css("background-color") + ' !important;');
}
然后我把它的文件准备(以设置初始主题背景)和我将它设置为这样的ThemeSelector OnClose事件;
$function() {
updateBodyBackground();
$('#switcher').themeswitcher({ expires: 365, path: '/', loadTheme: "sunny", onClose: updateBodyBackground });
}
在Firefox中没有做任何事情,似乎是Chrome上的一个变化,选择器在IE8中似乎不起作用。
有关如何更改背景以更好地匹配选定的jQuery UI主题的任何建议?
谢谢!