本文實例講述了jquery ui 實現(xiàn) tab標(biāo)簽功能。分享給大家供大家參考,具體如下:
<!DOCTYPE html><html><head> <title>www.companysz.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" 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測試上述代碼運行效果。
更多關(guān)于jQuery相關(guān)內(nèi)容可查看本站專題:《jQuery頁面元素操作技巧匯總》、《jQuery常見事件用法與技巧總結(jié)》、《jQuery常用插件及用法總結(jié)》、《jQuery擴(kuò)展技巧總結(jié)》及《jquery選擇器用法總結(jié)》
希望本文所述對大家jQuery程序設(shè)計有所幫助。
新聞熱點
疑難解答