html文字纵向导航栏,JS+CSS实现另类带提示效果的竖向导航菜单

本文实例讲述了JS+CSS实现另类带提示效果的竖向导航菜单。分享给大家供大家参考。具体如下:

这是一款JS+CSS打造另类带提示的竖向导航菜单,觉得挺不错,只是美工水平有限,有兴趣的朋友就请继续完善吧。

运行效果截图如下:

47a81609b126c797cf8e9c64166367e1.png

在线演示地址如下:

具体代码如下:

带提示的竖向导航菜单

#coolmenu{

border: 1px solid black;

width: 160px;

background-color: #E6E6E6;

}

#coolmenu a{

font: bold 13px Verdana;

padding: 2px;

padding-left: 4px;

display: block;

width: 100%;

color: black;

text-decoration: none;

border-bottom: 1px solid black;

}

html>body #coolmenu a{

width: auto;

}

#coolmenu a:hover{

background-color: black;

color: white;

}

#tabledescription{

width: 100%;

height: 3em;

padding: 2px;

filter:alpha(opacity=0);

-moz-opacity:0;

}

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)

}

希望本文所述对大家的JavaScript程序设计有所帮助。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值