HELP! lol i cant figure it out!! aaarrrghhhh
heres what i got
HTML:
<html xmlns="http://www.w3.org/1999/xhtml" class="bg1">
Jquery:
$(document).ready(function(){
var identifier = window.location.pathname;
switch(identifier)
{
case: 'where-to-buy-our-goods.php';
$('html').removeClass('bg1').addClass('bg2');
break;
case: 'about.php';
$('html').removeClass('bg1').addClass('bg3');
break;
case: 'press.php';
$('html').removeClass('bg1').addClass('bg4');
break;
case: 'contact.php';
$('html').removeClass('bg1').addClass('bg5');
break;
}
});
also i think this might have something to do with it…
my site is in a folder on the root as a tester…
so the url is http://www.URL.com/Folder/about.php for exapmle… idk if this changes what the window.location.pathname should look like…
please help
In order to decide off the path of the url bar:
Substitute body for the proper tag.
Perhaps though, there are better alternatives to this… couldn’t you have different body classes to change the background image depending on what page you are on?