关于bootstrap中tab的使用

一引入相关文件

1、bootstrapvoucherinstant.css

2、jquery-2.1.3.min.js

3、bootstrap.js

二、相应的jsp页面

[html]  view plain  copy
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  
  2. <%  
  3. String path = request.getContextPath();  
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
  5. %>  
  6.   
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
  8. <html>  
  9.   <head>  
  10.     <base href="<%=basePath%>">  
  11.       
  12.     <title>My JSP 'bootstrap.jsp' starting page</title>  
  13.       
  14.     <meta http-equiv="pragma" content="no-cache">  
  15.     <meta http-equiv="cache-control" content="no-cache">  
  16.     <meta http-equiv="expires" content="0">      
  17.     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">  
  18.     <meta http-equiv="description" content="This is my page">  
  19.     <link rel="stylesheet" type="text/css" href="bootstrap/bootstrapvoucherinstant.css"/>  
  20.     <script type="text/javascript" src="bootstrap/jquery-2.1.3.min.js"></script>  
  21.     <script type="text/javascript" src="bootstrap/bootstrap.js"></script>  
  22.   </head>  
  23.   <body>  
  24.     <div class="body_div">  
  25.         <div class="navigation">  
  26.             标题部分  
  27.         </div>  
  28.         <ul id="myShopTab" class="nav nav-tabs">  
  29.             <li class="active">  
  30.                 <a href="#tab1" data-toggle="tab">群组记录</a>  
  31.             </li>  
  32.             <li>  
  33.                 <a href="#tab2" data-toggle="tab">客服记录</a>  
  34.             </li>  
  35.         </ul>  
  36.         <div id="myTabContent" class="tab-content">  
  37.             <div class="tab-pane fade in active" id="tab1"></div>  
  38.             <div class="tab-pane fade" id="tab2">  
  39.                 <iframe src="index.jsp" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="100%" height="450px;"></iframe>  
  40.             </div>  
  41.         </div>  
  42.     </div>  
  43.   </body>  
  44. </html>  
[html]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  
  2. <%  
  3. String path = request.getContextPath();  
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
  5. %>  
  6.   
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
  8. <html>  
  9.   <head>  
  10.     <base href="<%=basePath%>">  
  11.       
  12.     <title>My JSP 'bootstrap.jsp' starting page</title>  
  13.       
  14.     <meta http-equiv="pragma" content="no-cache">  
  15.     <meta http-equiv="cache-control" content="no-cache">  
  16.     <meta http-equiv="expires" content="0">      
  17.     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">  
  18.     <meta http-equiv="description" content="This is my page">  
  19.     <link rel="stylesheet" type="text/css" href="bootstrap/bootstrapvoucherinstant.css"/>  
  20.     <script type="text/javascript" src="bootstrap/jquery-2.1.3.min.js"></script>  
  21.     <script type="text/javascript" src="bootstrap/bootstrap.js"></script>  
  22.   </head>  
  23.   <body>  
  24.     <div class="body_div">  
  25.         <div class="navigation">  
  26.             标题部分  
  27.         </div>  
  28.         <ul id="myShopTab" class="nav nav-tabs">  
  29.             <li class="active">  
  30.                 <a href="#tab1" data-toggle="tab">群组记录</a>  
  31.             </li>  
  32.             <li>  
  33.                 <a href="#tab2" data-toggle="tab">客服记录</a>  
  34.             </li>  
  35.         </ul>  
  36.         <div id="myTabContent" class="tab-content">  
  37.             <div class="tab-pane fade in active" id="tab1"></div>  
  38.             <div class="tab-pane fade" id="tab2">  
  39.                 <iframe src="index.jsp" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" width="100%" height="450px;"></iframe>  
  40.             </div>  
  41.         </div>  
  42.     </div>  
  43.   </body>  
  44. </html>  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值