我有我的base.css和我的網站上red.css。如何改變二次樣式與jQuery?
我喜歡做更改red.css爲blue.css當我按下按鈕一些,沒有失去base.css如何做到這一點?我曾經嘗試這樣做:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
if($.cookie("css")) {
$("link").attr("href",$.cookie("css"));
}
$(document).ready(function(){
$("#troca_faccao").click(function() {
$(this).parent().find("#painel_faccao").slideDown('fast').show(); //Drop down the subnav on click
$(this).hover(function() {
}, function(){
$(this).parent().find("#painel_faccao").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
});
})
$("#painel_faccao li a").click(function() {
$("link").attr("href",$(this).attr('rel'));
$.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
return false;
});
});
</script>
和DIV:
<div id="painel_faccao" style="display: none">
<p>A Escolha é Sua!</p>
<ul>
<li class="horda"><a href="#" rel="horde.css">HORDA</a></li>
<li class="alianca"><a href="#" rel="aliance.css">ALIANÇA</a></li>
</ul></div>
哇..多數民衆贊成偉大的!!我用你或者接聽和答對了!完美的作品!..老兄! – Preston 2011-01-21 18:50:42