我嘗試切換我的主題,但是...它不起作用。 我希望有一個默認的樣式(負載,當我打開網頁),我想用一個在javascript中切換主題
我試試這個切換,但它不工作:
<link rel="stylesheet" type="text/css" href="script/easyui/themes/dark/easyui.css?v=20130913"/>
這是改變的主題和變革:
<script> var color_mode;
switch (select_box_chosen_color) {
case "blue":
color_mode = 'script/easyui/themes/default/easyui.css';
break;
case "orange":
color_mode = 'script/easyui/themes/dark/easyui.css';
break;
}
var link = $('head').find('link:first');
link.attr('href', color_mode); </script>
和我的開關:
<form action="#" action="post">
<select name="select_box_chosen_color" id="select_box_chosen_color">
<option value="blue">blue</option>
<option value="orange">yellow</option>
</select>
<input type="submit">
</form>
那麼你在哪裏設置'select_box_chosen_color'? :) – 2014-10-10 17:27:42
我是一個新的JavaScript所以...我的設置,你是什麼意思? – 2014-10-10 17:30:07
在_JavaScript_中,您是否創建了變量'select_box_chosen_color'併爲其賦值? – 2014-10-10 17:51:13