首页 > 编程 > JavaScript > 正文

jquery ui 实现 tab标签功能示例【测试可用】

2019-11-19 11:08:24
字体:
来源:转载
供稿:网友

本文实例讲述了jquery ui 实现 tab标签功能。分享给大家供大家参考,具体如下:

<!DOCTYPE html><html><head>  <title>www.VeVB.COm tab切换</title>  <style type="text/css">   #tabs{    width:500px;    height:500px;    margin:0 auto;   }   .ui-widget-header{    border:1px solid grey;    background:grey;    color:#fff;    font-weight:bold;   }  </style>  <link rel="stylesheet" href="https://cdn.bootcss.com/jqueryui/1.11.0/jquery-ui.css" rel="external nofollow" media="screen"/>  <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>  <script type="text/javascript" src="https://cdn.bootcss.com/jqueryui/1.10.4/jquery-ui.min.js"></script> </head> <body>  <div id="tabs">  <ul>   <li><a href="#tabs-1" rel="external nofollow" >first tab</a></li>   <li><a href="#tabs-2" rel="external nofollow" >second tab</a></li>  </ul>  <div id="tabs-1">   <p>this is the first tab</p>  </div>  <div id="tabs-2">   <p>this is the second tab</p>  </div>  </div>  <script>   $(function(){   $("#tabs").tabs();   });  </script></body></html>

运行效果:

感兴趣的朋友可以使用在线HTML/CSS/JavaScript代码运行工具http://tools.VeVB.COm/code/HtmlJsRun测试上述代码运行效果。

更多关于jQuery相关内容可查看本站专题:《jQuery页面元素操作技巧汇总》、《jQuery常见事件用法与技巧总结》、《jQuery常用插件及用法总结》、《jQuery扩展技巧总结》及《jquery选择器用法总结

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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表