2011-05-24 32 views
0

我有这个代码,它适用于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/

+0

哪个IE版本。反正检查:http://stackoverflow.com/questions/423172/can-i-have-multiple-background-images-using-css – roberkules 2011-05-24 19:24:45

+3

多背景图像在一个单一的背景声明是一个CSS3事情。任何低于8的IE都会有超级糟糕的CSS支持。 – 2011-05-24 19:25:16

回答

0

尝试添加CSS属性

zoom:1;
在IE7中,这使得背景图像奇迹般地出现。不要问我为什么,它只是。

+0

我添加了这个:'button [0] .style.zoom =“1”;'并且问题依然存在...... – 2011-05-24 19:28:36

+0

没有在您的代码上滚动以查看您试图将两个背景图像放在一个DIV。对于那个很抱歉 – locrizak 2011-05-24 19:56:54

相关问题