Hide div based on url
Posted
by
Ghetto Styles
on Stack Overflow
See other posts from Stack Overflow
or by Ghetto Styles
Published on 2011-12-01T09:44:39Z
Indexed on
2011/12/01
9:49 UTC
Read the original article
Hit count: 162
html
Sorry if this is another repost. I have been attempting to find a solution but nothing works that I have tried. I am using a blog which I have full html control over. I can usually find my way around basic html but when it comes to Java or CSS I am a complete newb. Sorry, I know absolutely nothing.
Now that that is out of the way. I have two sidebar div's that I am trying to hide on one specific url to utilize more space for a content iframe. This is one of the coded I have tried to use which doesn't seem to work or I am missing something.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="text/javascript"
<?php
$(function(){
if (window.location.search === "mywebsite/Videos.html") {
$('#navleft').hide();
} else {
$('#navleft').show();
}
});
?>
</script>
Please remember I do not know anything when it comes to php or java. I want to do this for both #navright and #navleft. Also this is in the CSS section. Thanks for any help!!
#navright{ width: 200px; }
#navleft{ width: 200px; }
#content{ margin:0px; }
© Stack Overflow or respective owner