這裏一點點澄清是我的代碼:我需要動態地設置懸停BG
function recordStarted() {
$("#red_button").css("background","url(stop.png)");
$("#red_button").css("background-repeat","no-repeat");
$("#red_button:hover").css("background","url(stop-hover.png)");
$("#red_button:hover").css("background-repeat","no-repeat");
}
我有div層的背景由第二線被設置,但是當我嘗試設置懸停背景,它只是成爲背景。我將如何動態設置:懸停背景?
CSS:
.red_button
{
background:url(record.png);
padding: 19px 251px;
cursor: pointer;
background-repeat: no-repeat;
}
.red_button:hover
{
background:url(record-hover.png);
cursor: pointer;
background-repeat: no-repeat;
}
你不這樣做與PHP。 – 2013-03-06 02:31:55
那我該怎麼做呢? – Christian 2013-03-06 02:34:29
對不起,在一個PHP文件的JavaScript中的CSS。你會怎麼做呢? – Christian 2013-03-06 02:35:27