JS实现Tab标签(选项卡)切换效果
来源:互联网 发布:python数据库查询结果 编辑:程序博客网 时间:2024/04/29 02:08
最近在做一个既能批量导入,也能单个录入的功能,具体实现是在一个jsp页面中采用了一个tab标签,具体效果如下:
点击鼠标可以切换,具体实现如下:
<html> <head> <style type="text/css"> div{ font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif;}/**/ul.TabBarLevel{list-style:none;margin:0;padding:0;height:29px;background-image:url(images/tabbar_level1_bk.gif);}ul.TabBarLevel li{float:left;padding:0;height:29px;margin-right:1px;background:url(images/tb_left_bk.gif) left top no-repeat;font-size: 9pt;}ul.TabBarLevel li a{display:block;line-height:29px;padding:0 20px;color:#333;background:url(images/tb_right_bk.gif) right top no-repeat;white-space: nowrap;font-size: 9pt;/*font-weight: bold;*/}ul.TabBarLevel li.Selected{background:url(images/tb_selected_left_bk.gif) left top no-repeat;font-size: 8pt;}ul.TabBarLevel li.Selected a{background:url(images/tb_selected_right_bk.gif) right top no-repeat;}ul.TabBarLevel li a:link,ul.TabBarLevel li a:visited{color:#006;text-decoration:none;}ul.TabBarLevel li a:hover,ul.TabBarLevel li a:active{color:#0033CC;text-decoration:none;}ul.TabBarLevel li.Selected a:link,ul.TabBarLevel li.Selected a:visited{color:#cc0000;text-decoration:none;font-weight: bold;}ul.TabBarLevel li.Selected a:hover,ul.TabBarLevel li.Selected a:active{color:#cc0000;text-decoration:none;}.framediv{width:100%;height: expression(document.body.clientHeight-108);padding:0;margin:0;overflow: auto;position: absolute;}.CContent{background-color: #FFFFFF;width:100%;}</style> <script type="text/javascript"> function getTab(flag) { var elList, i; elList = document.getElementsByTagName("li"); for (i = 0; i < elList.length; i++){ elList[i].className =""; } elList[flag].className ="Selected"; elList[flag].blur();}function gotoTab(flag){ if("0"==flag){//控制div 隐藏 document.getElementById("luru").style.display = ""; document.getElementById("shangchuan").style.display = "none";} else if("1"==flag){document.getElementById("luru").style.display = "none"; document.getElementById("shangchuan").style.display = "";}getTab(parseInt(flag));}</script> <meta name="GENERATOR" content="MSHTML 8.00.7600.16535"> </head> <body> <DIV class="div_content" style="width:100%;border:1px;background-color:#FFFFFF;border-color: blue"> <div style="padding:0;width:100%" align="center"><ul class="TabBarLevel" id="TabPage" style="float:center;"><li class="Selected" style="margin-left: 5px"><a href="javascript:void(0)" onFocus="this.blur();"onClick="gotoTab('0');">测试test1</a></li><li><a href="javascript:void(0)" onFocus="this.blur();"onClick="gotoTab('1');">测试test2</a></li></ul> </div> </DIV> <div class="framediv" id="luru" style="overflow: auto;"><form action="epolicyapply.do?method=addApply" method="post"enctype="multipart/form-data" onsubmit="return changeAction(this);" ><input type="hidden" name="customerID" value="" /><input type="hidden" name="singleSign" value=""/><input type="hidden" name="unitCode" value=""><table width="600%" border="0" cellpadding="0" cellspacing="0"class="CContent" align="center"><tr><td>这里是测试test1里的内容,Hi,lllllll</td></tr></table></form> </div> <div class="framediv" id="shangchuan" style="display: none;overflow: auto;"><form action="/commonepolicyapply.do?method=uploadExcel"method="post" enctype="multipart/form-data" onsubmit=""><fieldset><legend>test</legend><table width="98%" border="0" align="center" cellpadding="2"cellspacing="1"><tr> <td> 速度飞洒地方撒旦法师</td> </tr></table></fieldset></form> </div> </body> </html>
具体代码及图片,见我的资源 http://download.csdn.net/detail/yansong_8686/5988755
- JS实现Tab标签(选项卡)切换效果
- tab标签(选项卡)切换实现
- tab标签(选项卡)切换实现
- jquery实现tab标签选项卡自动切换效果
- 【js基础】Tab选项卡切换效果实现
- 简单纯js实现网页tab选项卡切换效果
- 纯JS实现的简单tab选项卡切换效果
- tab -选项卡切换js效果
- 简单几行js实现tab选项切换效果
- 使用js实现tab选项卡效果
- tab选项卡切换效果
- 切换选项卡tab效果
- js(JavaScript)代码实现的TAB标签切换效果
- js实现切换Tab标签
- 选项卡(Tab)切换效果与关联事件处理实现
- jQuery+css3实现的超酷圆角tab选项卡切换效果
- Android仿微信底部实现Tab选项卡切换效果
- JS实现选项卡切换效果
- IOS键盘的相关设置
- Stanford机器学习---第二讲. 多变量线性回归 Linear Regression with multiple variable
- 事务
- 获取照片的属性信息
- 关于android编程中遇到的Could not find class 'com.swetake.util.Qrcode错误的原因及解决办法
- JS实现Tab标签(选项卡)切换效果
- opencv源码解析之:hog源码分析
- 关心设计的一些心得(很多人说设计就是分类,我觉得设计就是分层)
- 泛型
- mongodb源码分析-数据插入
- url请求最大长度
- Codeforces Beta Round #47 / 50A Domino piling(贪心)
- 设置图标按钮
- Stanford机器学习---第三讲. 逻辑回归和过拟合问题的解决 logistic Regression & Regularization