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
Post a Comment