最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

js動態(tài)修改整個頁面樣式達到換膚效果

 更新時間:2014年05月23日 09:54:07   作者:  
這篇文章主要介紹了通過js動態(tài)修改整個頁面樣式達到換膚效果,需要的朋友可以參考下
jsPro1\js動態(tài)修改整個html頁面樣式(換膚).html
復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>動態(tài)修改頁面樣式</title>
<link href="css/blue.css" rel="stylesheet" id="mylink"/>
<script type="text/javascript">
function gel(id) {
return document.getElementById(id);
}

window.onload = function() {
//更換css文件
var lis = gel("uList").childNodes;
for (var i = 0; i < lis.length; i++) {
if (lis[i].nodeType == 1) {
lis[i].onclick = function () {
gel("mylink").href = "css/" + this.className + ".css";
};
}
}
};

</script>
</head>

<body>
<div>
<span>修改整個頁面的樣式</span><br/>
<input type="text" id="txt"/>
<input type="button" value="提交" class="btn"/>
</div>

<ul id="uList" style="text-decoration: none;margin-top: 100px;">
<li style="display: block;width: 30px;height: 20px;background-color: red;" class="red"></li>
<li style="display: block;width: 30px;height: 20px;background-color: blue" class="blue"></li>
</ul>
</body>
</html>

jsPro1\css\red.css
復(fù)制代碼 代碼如下:

* {
margin: 0px;padding: 0px;
}


body {
background-color: #eeeeee;
}
span {
color: red;
}
#txt {
color: #f00;border: 1px solid #7d1515;
}
.btn {
background-color: #a52a2a;border: none;color: white;width: 100px;height: 28px;
}

jsPro1\css\blue.css
復(fù)制代碼 代碼如下:

* {
margin: 0px;padding: 0px;
}


body {
background-color: #eeeeee;
}
span {
color: blue;
}
#txt {
color: #0000cd;border: 1px solid #006400;
}
.btn {
background-color: #0000cd;border: none;color: white;width: 100px;height: 28px;
}

相關(guān)文章

最新評論

乌审旗| 姜堰市| 会理县| 尉氏县| 婺源县| 台北市| 景泰县| 南丹县| 军事| 浦县| 抚远县| 大方县| 金塔县| 同江市| 舟山市| 鱼台县| 藁城市| 调兵山市| 达州市| 彭州市| 资阳市| 茂名市| 修文县| 西平县| 顺平县| 通州市| 大厂| 朔州市| 新源县| 若羌县| 银川市| 新兴县| 辛集市| 蚌埠市| 水富县| 灵石县| 凌云县| 西乡县| 年辖:市辖区| 柞水县| 积石山|