jQuery ui选项卡 [英] jQuery ui tabs

查看:84
本文介绍了jQuery ui选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里做错了什么?我正在尝试使用jQuery UI选项卡. 目前无法正常运作. 我以为我会使用Google版本,以便将其缓存. 我想找到Google也有ui.tabs.js的地方.

What am I doing wrong here? I'm trying to get started with jQuery UI tabs. Right now it's not working. I thought I'd use the Google version so that it would be cached. I'd like to find where Google has ui.tabs.js as well.

<html>
<head>
<link rel="stylesheet" type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css">
<script src="http://www.google.com/jsapi"></script>  
<script type="text/javascript">  
google.load("jquery", "1");
google.load("jqueryui", "1");
google.setOnLoadCallback(function() {  
    $("#myTabs").tabs();
});  
</script>  
<script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.tabs.js"></script>
</head>

<body>
<ul id="myTabs">
    <li><a href="#0"><span>Tab 1</span></a></li>
    <li><a href="#1"><span>Tab 2</span></a></li>
</ul>
<div id="0">This is the content panel linked to the first tab, it is shown by default.</div>
<div id="1">This content is linked to the second tab and will be shown when its tab is clicked.</div>
</body>
</html>

推荐答案

您需要将所有选项卡放在同一个容器中:

You need to enclose all the tabs in the same continer:

<div id="myTabs">
<ul>
    <li><a href="#0"><span>Tab 1</span></a></li>
    <li><a href="#1"><span>Tab 2</span></a></li>
</ul>
<div id="0">This is the content panel linked to the first tab, it is shown by default.</div>
<div id="1">This content is linked to the second tab and will be shown when its tab is clicked.</div>
</div>

这篇关于jQuery ui选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆