Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/blackst/public_html/tutorials/descriptionmenu.php on line 1
Warning: include(http://black-stripes.net/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/blackst/public_html/tutorials/descriptionmenu.php on line 1
Warning: include() [function.include]: Failed opening 'http://black-stripes.net/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blackst/public_html/tutorials/descriptionmenu.php on line 1
Description Menu
This tutorial shows you how to get a menu where you visitors can read small descriptions for each site when they hover over the link.
1. Place this code in your <head> tag. You can change the look on the description by editing within the style tags.
<style type="text/css">
#menu{
border: 1px solid #808080;
width: 300px;
background-color: #fcfcfc;
}
#menu a{
font: normal 11px arial;
padding: 2px;
padding-left: 4px;
display: block;
width: 100%;
color: #ffffff;
text-decoration: none;
border-bottom: 3px solid red;
}
html, body #menu a{
width: auto;
}
#menu a:hover{
background-color: black;
color: white;
}
#tabledescription{
width: 100%;
height: 3em;
padding: 2px;
filter:alpha(opacity=0);
-moz-opacity:0;
}
</style>
<script type=”text/javascript”>
var baseopacity=0
function showtext(thetext){
if (!document.getElementById)
return
textcontainerobj=document.getElementById(”tabledescription”)
browserdetect=textcontainerobj.filters? “ie” : typeof textcontainerobj.style.MozOpacity==”string”? “mozilla” : “”
instantset(baseopacity)
document.getElementById(”tabledescription”).innerHTML=thetext
highlighting=setInterval(”gradualfade(textcontainerobj)”,50)
}
function hidetext(){
cleartimer()
instantset(baseopacity)
}
function instantset(degree){
if (browserdetect==”mozilla”)
textcontainerobj.style.MozOpacity=degree/100
else if (browserdetect==”ie”)
textcontainerobj.filters.alpha.opacity=degree
else if (document.getElementById && baseopacity==0)
document.getElementById(”tabledescription”).innerHTML=”"
}
function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}
function gradualfade(cur2){
if (browserdetect==”mozilla” && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.2, 0.99)
else if (browserdetect==”ie” && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=20
else if (window.highlighting)
clearInterval(highlighting)
}
</script>
2. And then paste this where you want the menu.
<div id="menu" align="center">
<a href="PAGEURL" onMouseover="showtext('Description here')" onMouseout="hidetext()">PAGENAME</a>
<a href="PAGEURL" onMouseover="showtext('Description here')" onMouseout="hidetext()">PAGENAME</a>
<a href="PAGEURL" onMouseover="showtext('Description here')" onMouseout="hidetext()">PAGENAME</a>
<div id="tabledescription">
</div></div>
3. Change PAGENAME to your urls. Write your description where it says Description here.
Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/blackst/public_html/tutorials/descriptionmenu.php on line 87
Warning: include(http://black-stripes.net/footer.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/blackst/public_html/tutorials/descriptionmenu.php on line 87
Warning: include() [function.include]: Failed opening 'http://black-stripes.net/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blackst/public_html/tutorials/descriptionmenu.php on line 87