簡體   English   中英

Windows小工具-javascript更改CSS

[英]Windows gadget - javascript changing CSS

我正在按計划在Windows桌面上學。 我有更改問題,因為“ getDay”的值仍為0並顯示default.css。

在這里檢查我的代碼:

var currDate = new Date();
var currDay = currDate.getDay();

var newCSS = "default.css";
if (currDay = 0) newCSS = "default.css";
if (currDay = 1) newCSS = "pondeli.css";
if (currDay = 2) newCSS = "utery.css";
if (currDay = 3) newCSS = "streda.css";
if (currDay = 4) newCSS = "ctvrtek.css";
if (currDay = 5) newCSS = "patek.css";
if (currDay = 6) newCSS = "default.css";

document.getElementById('siteCSS').href = newCSS;

怎么了? :-)

在IF中使用“ ==”:

if (currDay == 0)...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM