我有這個代碼,它適用於Chrome和Firefox,但在IE上只顯示第二個背景圖片...你知道爲什麼嗎?爲什麼多個背景圖片不適用於IE?
$('input[type=button]').click(function() {
//search for the button
var button = document.getElementsByName("contactme");
//change the image
button[0].style.background = "url(http://www.restorationsos.com/imgs/loader.gif) no-repeat, url('http://www.restorationsos.com/imgs/btnBG.gif') repeat-x";
//change the text
button[0].value = "We Are Connecting You...";
button[0].style.textAlign = "right";
button[0].style.color = "#ea2400";
//disable the button
button[0].disabled = true;
});
直播:http://jsfiddle.net/cristiboariu/pUeue/21/
哪個IE版本。反正檢查:http://stackoverflow.com/questions/423172/can-i-have-multiple-background-images-using-css – roberkules 2011-05-24 19:24:45
多背景圖像在一個單一的背景聲明是一個CSS3事情。任何低於8的IE都會有超級糟糕的CSS支持。 – 2011-05-24 19:25:16