DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> 動態調用CSS文件的JS代碼
動態調用CSS文件的JS代碼
編輯:關於JavaScript     
復制代碼 代碼如下:
<script type="text/javascript" language="javascript">
var _sn = ["df/common", "df/home2010"];
var _su = "http://www.jb51.net/skin/";
var Swidth = screen.width; var _se, _st;
for (i in _sn) {
_se = document.createElement("link");
_se.type = "text/css";
_se.rel = "stylesheet";
if (Swidth >= 1280) {
_st = _su + _sn[i] + ".w.css";
} else {
_st = _su + _sn[i] + ".css";
}
_se.href = _st;
document.getElementsByTagName("head")[0].appendChild(_se);
}
</script>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved