2014-07-09 136 views
1

Jquery选项卡问题:Jquery选项卡用户界面问题

您好面临JQuery选项卡UI的问题。

.vbhtml:

<script type ="text/javascript"> 
    $(document).ready(function() { 
     $('.tabs').tabs(); 
    }); 
</script> 

<div class="tabs"> 
     <ul> 
      <li><a href="#tabs-1">Tab1</a></li> 
      <li><a href="#tabs-2">Tab2</a></li> 
     </ul> 
    <div id="tabs-1"></div> 
    <div id="tabs-2"></div> 
</div> 
在我_Layout.vbhtml

<link href="~/Content/jquery-ui.css" rel="stylesheet" /> 
<link href="~/Content/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" /> 
<link href="~/Content/Style.css" rel="stylesheet" /> 

<script src="~/Scripts/jquery-2.1.1.min.js"></script> 

收到此错误:

0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'tabs' 

试图这样做很多事情,但没有找到任何解决方案。可能缺少一个基本的东西,但无法找出问题。 任何帮助对我来说都很有帮助。

谢谢。

回答

0

只要改变为:

<script src="~/Scripts/jquery-2.1.1.min.js"></script> 
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> 
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"> 
<link href="~/Content/jquery-ui-1.10.4.custom.min.css" rel="stylesheet" /> 
<link href="~/Content/Style.css" rel="stylesheet" /> 
+0

非常感谢。这是行得通的。对于jquery而言是新手,需要一些信息。你能简单地告诉我,为了与Jquery一起工作,我们需要在Visual Studio中包含哪些必需的必需文件?脚本和css文件。 – sush

0

是,@Robert罗萨斯的解决方案应该工作。在加载依赖于jQuery插件的jQuery UI插件之前,应先使用jQuery插件。