Domanda

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

È stato utile?

Soluzione

Use backgroung-color instead of background:

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

or

$(this).css('background-color', '#aaaaaa');
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top