我有一个JavaScript函数:
($('.expand').parent().next().children('li')).click(function() {
$(this).css('background','#aaaaaa');
window.location=($(this).children('a')).attr('href');
});
我在ios设备中获得背景颜色但在samsung android原生浏览器中没有工作。
有没有人遇到过这个问题。请指教。
被修改
如果我使用
($('.expand').parent().next().children('li')).click(function() {
$(this).css('background','#aaaaaa');
});
没有window.location我得到了背景颜色,但我想要bgcolor和重定向
答案 0 :(得分:0)
使用背景色而不是背景色:
$(this).css({backgroundColor: '#aaaaaa'});
或
$(this).css('background-color', '#aaaaaa');