日期:2014-05-18 浏览次数:20497 次
<html>
<script language="javascript">
var index=0;
function changeColor()
{
window.setTimeout("changeColor()",1000)
if(index==0)
{
document.body.style.backgroundColor="#00FF00";
}
if(index==1)
{
document.body.style.backgroundColor="#FF0000";
}
if(index==2)
{
document.body.style.backgroundColor="#0000FF";
index=-1;
}
index++
}
window.onload=changeColor
</script>
<body>
</body>
</html>
------解决方案--------------------
不知道你要實現怎樣的動態
給你在後臺設置頁面背景色的代碼吧
this.Response.Write("<body><script language=\"javascript\" type=\"text/javascript\">document.body.bgColor = \"#123456\";</script></body>");
------解决方案--------------------