js+css实现自动切换的简洁选项卡
2011-01-07 10:11
666 查看
<html> <head> <title>js+css实现自动切换的简洁选项卡_网页代码站(www.webdm.cn)</title> <style> .tab{width:100px;height:25px;background-color:#ccc;margin:0;padding:0; border-right:1px solid #666;} .tab_on{width:100px;height:25px;background-color:#eee;margin:0;padding:0; border-bottom:1px solid #666; border-top:1px solid #666; border-left:1px solid #666;} #show{ width:200px; height:100px; background-color:#eee; border-bottom:1px solid #666; border-top:1px solid #666; border-right:1px solid #666; line-height:30px; } </style> <script language="javascript" type="text/javascript"> <!-- var n=1; var time=1000; var strArr=new Array(); strArr[0]="webdm.cn"; strArr[1]="高质量代码下载"; strArr[2]="欢迎来到网页代码站"; strArr[3]="精品网页代码"; function init(){document.getElementById("show").innerHTML = strArr[0];} function show(){ n=n>strArr.length?1:n;//如果n>数组长度 则重新赋值为1,以便程序循环 for(i=1;i<(strArr.length+1);i++){//这里for用来改变当前tab的classname if(i==n) document.getElementById("tab_"+i).className = "tab_on"; else document.getElementById("tab_"+i).className = "tab"; } document.getElementById("show").innerHTML = strArr[n-1];//现实数据 n++; } setInterval("show()",time);//隔一秒执行一次 //--> </script> </head> <body onload="init()"> <table border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#eeeeee"> <tr> <td align="right"> <div id="tab_1" class="tab_on">ASP</div> <div id="tab_2" class="tab" >PHP</div> <div id="tab_3" class="tab" >JSP</div> <div id="tab_4" class="tab">JAVA</div> </td> <td bgcolor="#eeeeee"> <div id="show"></div> </td> </tr> </table> </body> </html> <br> <p> <a href="http://www.webdm.cn">网页代码站</a> - 最专业的代码下载网站 - 致力为中国站长提供有质量的代码!</p>
文章来自:http://www.webdm.cn/webcode/7683d359-651b-4a11-9338-0dc94473f367.html
相关文章推荐
- JS实现自动定时切换的简洁网页选项卡效果
- JS实现自动定时切换的简洁网页选项卡效果
- div+css+js实现鼠标略过自动切换的选项卡
- 用html+css+js实现选项卡切换效果
- JS+CSS自动切换选项卡
- JS+CSS实现自动改变切换方向图片幻灯切换效果的方法
- 初识网站前端--用简单的HTML+CSS+js实现的选项卡切换效果
- HTML CSS +js 实现tab选项卡,自动轮换
- js实现简单选项卡与自动切换效果的方法
- HTML+CSS+JS实现banner横幅自动切换效果
- JS+CSS实现的简洁的TAB选项卡
- JS+CSS实现自动改变切换方向图片幻灯切换效果的方法
- JS+CSS实现自动切换的网页滑动门菜单效果代码
- html+css+js实现选项卡切换
- JS+CSS实现自动切换的网页滑动门菜单效果代码
- js实现选项卡切换效果
- 关于利用js实现css切换布局视图的方法
- HTML+JS+CSS 实现TAB切换
- 完美实现js选项卡切换效果(一)
- jquery实现tab标签选项卡自动切换效果