Javascript Jquery选项卡不隐藏未选择的选项卡
我在IE9上设置了一个jquery选项卡,代码如下所示Javascript Jquery选项卡不隐藏未选择的选项卡,javascript,jquery,html,tabs,internet-explorer-9,Javascript,Jquery,Html,Tabs,Internet Explorer 9,我在IE9上设置了一个jquery选项卡,代码如下所示 <head> <!-- jquery includes --> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"&
<head>
<!-- jquery includes -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js"></script>
<!-- tabs stuff-->
<script>
$(function(){
$( "#tabs" ).tabs();
});
</script>
</head>
<body>
<div id= "tabs">
<ul>
<li><a href="#tabs-1">Search</a></li>
<li><a href="#tabs-2">Add/Modify</a></li>
</ul>
<div id= "tabs-1">
<form name= "search_form" method= "post" action= "/" onSubmit="return validate(this);">
<input id="name" type= "text"/>
<label> Search </label> <input type= "checkbox" id= "option" name= "option"/>
<input type= "submit" value= "Search" id= "search"/>
</form>
</div>
<div id= "tabs-2">
<p> This is getting shown, even though tab-2 is not selected </p>
</div>
</div> <!-- end of tabs container-->
<!-- right now, I've got the 'validate' function down here, but didn't feel like I needed
to include it to illustrate the problem I am having -->
</body>
$(函数(){
$(“#制表符”).tabs();
});
搜寻
即使未选择选项卡2,也会显示此信息
我想这就是所有相关的html/代码,有人能看到我的第二个标签内容出现的原因吗,不管是否选择了tab2?到目前为止,单击选项卡对我没有任何帮助。问题是您不能将最新版本的jQuery与该版本的jQuery ui一起使用
src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js"></script>
^^^^^
src=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.js">
^^^^^
将其更新为当前版本,就像您正在使用的CSS文件一样。可能是因为您的jQuery UI版本与最新的jQuery版本不兼容,您可以使用版本
1.10.4
:
<!-- jquery includes -->
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
问题似乎在于jQuery和jQuery ui的版本不匹配。谢谢,我在发布了各种脚本标记后发现了这一点。最后,从jquery站点的tabs部分发布了脚本标记,它成功了。愚蠢的我认为我的自动完成链接就足够了:保存多个可能重叠的脚本标记只是一个混乱的问题,对吗?比如说,它不会破坏功能吗?