Question

I have a JavaScript function as:

($('.expand').parent().next().children('li')).click(function() {
    $(this).css('background','#aaaaaa');
    window.location=($(this).children('a')).attr('href');    
  });

I am getting background color in ios devices but not working in samsung android native browsers.

Did anyone came across this issue. Please advice.

Edited

If I use

($('.expand').parent().next().children('li')).click(function() {
    $(this).css('background','#aaaaaa');
});

without window.location I am getting the background color but I want both bgcolor and redirection

Was it helpful?

Solution

Use backgroung-color instead of background:

$(this).css({backgroundColor: '#aaaaaa'});

or

$(this).css('background-color', '#aaaaaa');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top