風格切換,我有這個簡單的風格swicherPHP和CSS
style.css
body.defualt { background-color: RGB(230,197,173);
background-image:url("img/defualt.gif") ;
background-repeat: no-repeat ;
font-family : Lucida Handwriting;
color : white;
}
body.spring {
background-image:url("img/spring.png");
background-repeat: repeat ;
font-family : Arial Rounded MT Bold;
}
body.winter{
background-image:url("img/winter.png");
background-repeat: repeat ;
font-family : Comic Sans MS;
color : RGB(53,31,99);
}
a {text-decoration : none;
color :RGB(175,48,175);
}
a:hover {text-decoration :underline ;
text-transform: uppercase;
}
現在
當我改變defualt風格它改變 但時許刷新它的迴歸到defualt 我想知道如何拯救我的風格
<?php
if ($GLOBALS["language"]==arabic)
{include ("ar.php");}
else {include ("en.php");}
?>
<html >
<head>
<title>
MultiMedia
</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="function.js" > </script>
</head>
<body class="defualt">
<br/><br/>
<!-- header -->
<!-- MultiMedia -->
<h1 ><center><?php echo $header ; ?></center></h1>
<!-- theme selector -->
<table style="position:fixed;left:25px;top:210px;" >
<tr> <th> <?php echo $choose?><th> <tr/>
<tr>
<td align=center>
<a onclick ="change('defualt');" title="Defualt" ><img src="img/defualtTHM.gif" style="border-color:white;" border=2 /> </a>
</td>
</tr>
<tr>
<td align=center>
<a onclick ="change('spring');" title="Spring" ><img src="img/springTHM.png" style="border-color:white;" border=2 /> </a>
</td>
</tr>
<tr>
<td align=center>
<a onclick ="change('winter');" title="Winter" ><img src="img/winterTHM.png" style="border-color:white;" border=2 /> </a>
</td>
</tr>
什麼是JS'變化(..)'做? – Neal 2011-03-18 18:57:03
'if($ GLOBALS [「language」] == arabic)'should'if($ GLOBALS ['language'] =='arabic')'! – ThiefMaster 2011-03-18 18:58:01
好吧沒有關於語言的問題,但我需要讓我的新風格留下來,fanction.js通知有關新款式功能變化(主題){ document.body.className = theme; 警報(主題+「主題開啓」); } – 2011-03-18 19:01:55