js实现的Easy Tabs选项卡用法实例

本网页选项卡是Easy Tabs选项卡插件中的一个演示实例代码,是一个最简单的选项卡样式,稍带点动画色彩,希望大家喜欢哦。

运行效果截图如下:

js实现的Easy Tabs选项卡用法实例

在线演示地址如下:

具体代码如下:

<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Tabs选项卡</title> <style type="text/css"> /*Example for a Menu Style*/ .menu {background-color:#ececec; color:#272727; border-bottom:1px solid #d7d7d7; height:23px; font:11px Arial, Helvetica, sans-serif;} .menu ul {margin:0px; padding:0px; list-style:none; text-align:center;} .menu li {display:inline; line-height:23px;} .menu li a {color:#000000; text-decoration:none; padding:4px 5px 6px 5px; border-left:1px solid #ececec; border-right:1px solid #ececec;} .menu li a.tabactive {border-left:1px solid #d7d7d7; border-right:1px solid #d7d7d7; background-color:#CCCCCC; font-weight:bold; position:relative;} </style> <script type="text/javascript"> /*Important Function to blend the tabs in and out*/ function blendoff(idname) {document.getElementById(idname).style.display = 'none';} function blendon(idname) {document.getElementById(idname).style.display = 'block';} </script> <script type="text/javascript"> /*Function for our Tabmenu with 4 Tabs*/ function swichtabs(wert) { if (wert=='1'){ document.getElementById('tablink1').className='tab1 tabactive'; document.getElementById('tablink2').className='tab2'; document.getElementById('tablink3').className='tab3'; document.getElementById('tablink4').className='tab4'; }else if (wert=='2'){ document.getElementById('tablink1').className='tab1'; document.getElementById('tablink2').className='tab2 tabactive'; document.getElementById('tablink3').className='tab3'; document.getElementById('tablink4').className='tab4'; }else if (wert=='3'){ document.getElementById('tablink1').className='tab1'; document.getElementById('tablink2').className='tab2'; document.getElementById('tablink3').className='tab3 tabactive'; document.getElementById('tablink4').className='tab4'; } else if (wert=='4'){ document.getElementById('tablink1').className='tab1'; document.getElementById('tablink2').className='tab2'; document.getElementById('tablink3').className='tab3'; document.getElementById('tablink4').className='tab4 tabactive'; } } </script> </head> <body> <!--Start of the Tabmenu --> <div> <ul> <li><a href="#" title="">Tab 1 </a> </li> <li><a href="#" title="">Tab 2 </a></li> <li><a href="#" title=""id="tablink3">Tab 3 </a> </li> <li><a href="#" title=""id="tablink4" >Tab 4 </a> </li> </ul> </div> <!--End of the Tabmenu --> <!--Start Tabcontent 1 --> <div> Tabcontent 1 </div> <!--End Tabcontent 1--> <!--Start Tabcontent 2--> <div> Tabcontent 2 </div> <!--End Tabcontent 2 --> <!--Start Tabcontent 3--> <div> Tabcontent 3 </div> <!--End Tabcontent 3--> <!--Start Tabcontent 4--> <div> Tabcontent 4 </div> <!--End Tabcontent 4--> </body> </html>

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

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