Showing posts with label navbar. Show all posts
Showing posts with label navbar. Show all posts

Saturday, February 17, 2007

Toggle Show/Hide navbar Hack

Derya commented in one of my posts, alerting me to a hack that will enable you to put a script in a Page Element which will display a text show/hide navbar hack which when clicked upon will hide the navbar if it is displayed, and display the navbar if it is hacked. As I don't want to execute the hack in this blog, I tested it in the blog Computer and Internet Articles. The toggle switch (which is the text you see above) is placed at the bottom of the right sidebar, below my profile. Click on it and observe what happens to the navbar.

You can get Derya's hack here How to hide the navbar? if you are interested in the hack. It is very easy to implement. All you have to do is to get to the template editor, look for the <head> tag, then paste the script he has given. When I implemented the hack, I only made some small modification to the hack. I put a comment (part of a program that does nothing but document a program to make it easy to follow and understand). I put the comment
<!-- Show/Hide navbar begins --> followed by the script, then at the end of the script, I marked it with the comment
<!-- Show/Hide navbar ends -->

For easier understanding, I put the script below:


<head>

<!-- Show/Hide navbar begins -->
<script type="text/javascript">
var showHeader=false;
function ShowHideNav()
{
showHeader=!showHeader;
var nav=document.getElementById("navbar-iframe");
if (showHeader)
{
nav.style.visibility="visible";
nav.style.display="block";
}
else
{
nav.style.visibility="hidden";
nav.style.display="none";
}
}
</script>
<style type="text/css">
#navbar-iframe {
visibility: hidden;
display: none;
}
</style>
<!-- Show/Hide navbar ends -->



The part in black (<head>) is what is already in the template, and the part in red are what is added to the template.

You will then have to add this to a page element in a part of the blog that you choose:

<!-- Show/Hide navbar hack -->
<span style="cursor:pointer;" onclick="ShowHideNav();">
Show/Hide Navigation
</span>

Sunday, January 07, 2007

New Blogger (formerly beta): How to hide the navbar

A reader of my blogs asked how to hide the navbar.
I tried this hack from Remove navbar. It says to look for <style type="text/css"> and </style"> and add in some codes in between them. I could't find the tag <style type="text/css">, so what I did was I added the whole code:

<style type="text/css">

#navbar-iframe {
height: 0px;
visibility: hidden;
display: none;
}

</style>
<!-- End Hide Navbar -->


just after the <head> tag into this blog Digital Photography Articles and the navbar was successfully removed.

Actually, the navbar serve a useful function. It has a searchbar which allows one to search the blog, and it is not intrusive, just a narrow bar at the top of page. Anyway, if you really want to remove the navbar, but still want a searchbar to allow visitors to search your blog, you can sign up for AdSense and when you are approved, you can generate a sitesearch box for your blog like this blog Good Health Information.

You can apply to join the AdSense Program by clicking on the "Generate revenue from your site. Google AdSense" link at the top of the right sidebar. You can get more information about AdSense (how to generate a script for a sitesearch bar, for example) from this site Earning Online. If you have further questions, feel free to leave a comment, and I will try my best to answer.