Hello Guys I have a little issue with document.URL.indexOf in Javascript. I have a lounge page where I want to make the background transparent if there is "lounge" in the URL and I want to make the background different when I am viewing a single lounge but the URL still contains "lounge" cause the full link to a lounge is "lounge/view/1" How can I make it work so when I am in "view" to have the background I want and when I am in lounge to have it transparent.
This is the code I have for now:
if (document.URL.indexOf("lounge") > -1)
{
body.delay(400).css('background-color', 'transparent');
}
else
{
body.delay(400).css('background', '#b4b7b8');
}
I tried adding anothger "else if" saying if indexOF is "view" to go to the one I want but it didn't work.
Any suggestions ?