I am trying to add classes via jQuery when the (sidebars), side-pre & side-post, both are out, and when either one of them is out. Can anyone tell me the best way to do this? Here's what I've been trying to no avail:
if ( $( "body" ).hasClass( "empty-region-side-pre" ) || $( "body" ).hasClass( "empty-region-side-post" ) ) {
alert("Hello World");
$('.grid').css("background", "red");
};
This is just an example of the many things I've tried. I noticed also that nothing happens when the body has this class added, i.e. when a change is made. Do I need a click function or something?
Thanks in advance,
Danny