2015-07-03 122 views
0
// Use a black icon for secondary (grey gradient) backgrounds. 

if ($(this).hasClass('secondary') || $(this).css('color') === 'rgb(0, 0, 0)') { 
    filename = 'newwin-black-white-15-14.png'; 
} 

上面的代码是不是在IE8工作的jQuery/JavaScript的不是在IE 8的工作只能

+1

哪个版本的jQuery? 1.12以上已经下跌支持ie8以下。 –

+0

是否有任何JavaScript错误报告? – Alex

+0

jQuery 2.0并没有错误报告,而调试它跳过if条件只在IE8 – Ravindra

回答

0

的Internet Explorer 8不会对颜色返回RGB值,你应该做的,以涵盖所有情况如下:

if ($(this).hasClass('secondary') || $(this).css('color') === 'rgb(0, 0, 0)' || $(this).css('color') === '#000' || $(this).css('color') === '#000000') { 
    filename = 'newwin-black-white-15-14.png'; 
} 
+0

感谢它的工作.. :) – Ravindra