javascript - jQuery .css function not working when window.location is used -


i have javascript function as:

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

i getting background color in ios devices not working in samsung android native browsers.

did came across issue. please advice.

edited

if use

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

without window.location getting background color want both bgcolor , redirection

use backgroung-color instead of background:

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

or

$(this).css('background-color', '#aaaaaa'); 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -