Függöleges menü 13.
Kód
html
<div id="coolmenu">
<a href="//css-kodok.gportal.hu" target="_blank" onMouseover="showtext('Ide jöhet a menüről a leírás!')" onMouseout="hidetext()">CSS Themes</a>
<a href="http://lindadesign.weboldala.net/galeria/index.php" target="_blank" onMouseover="showtext('Ide jöhet a menüről a leírás!')" onMouseout="hidetext()">Brushok</a>
<a href="http://lindadesign.weboldala.net/galeria/index.php" target="_blank" onMouseover="showtext('Ide jöhet a menüről a leírás!')" onMouseout="hidetext()">Hátterek</a>
<a href="http://lindadesign.weboldala.net/avatars/icons.php" target="_blank" onMouseover="showtext('Ide jöhet a menüről a leírás!')" onMouseout="hidetext()">Ikonbázis</a>
<a href="http://titanic-online.fanzoom.net/" target="_blank" onMouseover="showtext('Ide jöhet a menüről a leírás!')" onMouseout="hidetext()">Titanic</a>
<div id="tabledescription"></div>
</div>
css
<style type="text/css">
#coolmenu{ /* alapkinézet. Háttér + keret és a menü szélessége + a leírás betűstílusa */
border: 0px solid black;
width: 150px;
background-color: #FFFFFF;
font-family: Tahoma;
font-size: 9px;
color: #999999;
}
#coolmenu a{ /* Kalapkinézet pl. a betűméret és betűszínnek */
padding: 2px;
padding-left: 6px;
display: block;
width: 100%;
color: black;
text-decoration: none;
border-left: 2px solid black;
border-bottom: 0px solid black;
font-family: Tahoma;
font-size: 10px;
font-weight: bold;
}
html>body #coolmenu a{
width: auto;
}
#coolmenu a:hover{ /* a menü, ha ráviszed a linkre az egeret */
background-color: black;
color: white;
}
#tabledescription{
width: 100%;
height: 3em;
padding: 2px;
filter:alpha(opacity=0);
-moz-opacity:0;
}
</style>
javascript
<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>
A kódokat egszerű modulban forráskód nézetben kell beilleszteni
|