使用 jQuery UI 选项卡时卡住了
我有三个 html 表,我想将它们放入选项卡中。
所有三个表都可以使用 AJAX 加载,但我想显示第一个表,并且还允许第一个表可 ajaxable。
最后,我需要让用户可以在第三个选项卡中进行搜索,并且这些结果(html 结果)将进入该选项卡。
问题是:当我运行当前代码时,它不允许我单击选项卡(它在 FireFox 中显示一些难看的样式),并且仅显示第三个选项卡。
这是之前的情况。
<h2>Title 1</h2>
<table>....data_A....</table>
<br/><br/>
<h2>Title 2</h2>
<table>....data_A....</table>
<br/><br/>
<h2>Title 3 - Search</h2>
<input id="name" type="textbox" />
<input id="search" type="submit" value="Search" />
<br/><br/>
这是我的 jQuery 尝试代码。
<asp:Content ContentPlaceHolderID="JavaScriptContent" runat="server">
<link type="text/css" href="../../Content/smoothness/jquery-ui-1.7.1.custom.css" rel="Stylesheet" />
<script src="/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script>
<SCRIPT type=text/javascript>
$(function() {
$("#tabs").tabs();
});
</SCRIPT>
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
<div id="tabs">
<ul>
<li href="ajax/data_a">Title 1</li>
<li href="ajax/data_b">Title 2</li>
<li href="#tab-3">Search</li>
</ul>
<div id="tab-1">
.... data_A table is put here ...
.... but will be updated via ajax when the tabs is clicked.
</div>
<div id="tab-3">
<input id="name" type="textbox" />
<input id="search" type="submit" value="Search" />
</div>
</div>
</asp:Content>
谁能帮我? 我做错了什么?
欢呼:)
I've got hree html tables which I wanted to put into tabs.
All three tables can be loaded using AJAX
but i want to show the first table and ALSO allow the first table to be ajaxable.
Lastly, I need to have the option for the user to SEARCH in the 3rd tab and those results (html result) goes into that tab.
The problem is: When I run my current code, it's not allowing me to click the tabs (it shows some uglyish style in FireFox) and the 3rd tab is only shown.
this is the before.
<h2>Title 1</h2>
<table>....data_A....</table>
<br/><br/>
<h2>Title 2</h2>
<table>....data_A....</table>
<br/><br/>
<h2>Title 3 - Search</h2>
<input id="name" type="textbox" />
<input id="search" type="submit" value="Search" />
<br/><br/>
and this is my jQuery attempt code.
<asp:Content ContentPlaceHolderID="JavaScriptContent" runat="server">
<link type="text/css" href="../../Content/smoothness/jquery-ui-1.7.1.custom.css" rel="Stylesheet" />
<script src="/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script>
<SCRIPT type=text/javascript>
$(function() {
$("#tabs").tabs();
});
</SCRIPT>
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
<div id="tabs">
<ul>
<li href="ajax/data_a">Title 1</li>
<li href="ajax/data_b">Title 2</li>
<li href="#tab-3">Search</li>
</ul>
<div id="tab-1">
.... data_A table is put here ...
.... but will be updated via ajax when the tabs is clicked.
</div>
<div id="tab-3">
<input id="name" type="textbox" />
<input id="search" type="submit" value="Search" />
</div>
</div>
</asp:Content>
can anyone help me? what have i done wrong?
cheer :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在
li
内有一个a
标记。li
没有href
属性。就在此处的源代码: http://stilbuero.de/jquery/tabs_3/
You have to have an
a
tag inside theli
's.li
's don't have thehref
attribute.Just at the source here: http://stilbuero.de/jquery/tabs_3/