JS实现漂亮的淡蓝色滑动门效果代码

这篇文章主要介绍了JS实现漂亮的淡蓝色滑动门效果代码,涉及JavaScript通过自定义函数遍历页面元素及动态设置元素属性的技巧,具有一定参考借鉴价值,需要的朋友可以参考下

本文实例讲述了JS实现漂亮的淡蓝色滑动门效果。分享给大家供大家参考。具体如下:

这款漂亮淡蓝色滑动门代码,感觉很不错哦。

运行效果截图如下:

JS实现漂亮的淡蓝色滑动门效果代码

在线演示地址如下:

具体代码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>漂亮淡蓝色滑动门代码</title> <style type="text/css"> body { font-size:12px; } .normal { list-style: none; float: left; padding: 5px 2px 2px 2px; width: 90px; text-align :center ; vertical-align :middle ; cursor :pointer ; border-bottom :solid 1px #9cd9f5; border-right :solid 1px #9cd9f5; background-color: #dee7f5; border-collapse :separate ; } .selected { list-style: none; float: left; padding: 5px 2px 2px 2px; width: 90px; text-align :center ; vertical-align :middle ; cursor :pointer ; border-bottom :solid 0px #9cd9f5; border-right :solid 1px #9cd9f5; background-color:#f8f8f8 ; } #divMainTab { border-left :solid 1px #9cd9f5; border-top :solid 1px #9cd9f5; float:left; margin: 0px; padding: 0px } .divContent { width: 474px; height: 400px; clear: both; border-bottom: solid 1px #9cd9f5; border-left: solid 1px #9cd9f5; border-right: solid 1px #9cd9f5; } a{ text-decoration: none; color: #00ccff; } a:hover { text-decoration: underline; color: #cc0000; } </style> <script language="javascript" type="text/javascript"> function changeTab(index) { for (var i=1;i<=5;i++) { document.getElementById ("li_"+i).className ="normal"; document.getElementById ("li_"+index).className ="selected"; document.getElementById ("div"+i).style.display ="none"; } document.getElementById ("div1").innerText= "www.jb51.net"+index; document.getElementById ("div"+index).style.display ="block"; } </script> </head> <body> <form runat="server"> <div> <div> <ul> <li><a href="#">最新更新</a> </li> <li><a href="#">阅读排行</a> </li> <li><a href="#">本月排行</a> </li> <li><a href="#">本日排行</a> </li> <li><a href="#">脚本之家</a> </li> </ul> </div> <div style ="display :block" class ="divContent"> 1号 </div> <div style ="display :none" class ="divContent"> 2号 </div> <div style ="display :none" class ="divContent"> 3号 </div> <div style ="display :none" class ="divContent"> 4号 </div> <div style ="display :none" class ="divContent"> 5号 </div> </div> </form> </body> </html>

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

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wggzyz.html