简体   繁体   English

jQuery UI选项卡效果不起作用

[英]jQuery UI tabs effects not working

I am trying to fade in tabs when clicked with the jQuery UI, but nothing happens. 使用jQuery UI单击时,我试图淡入选项卡,但没有任何反应。

The scripts are being loaded fine as the chrome "network" tab says that the GET request was successful in every case and I am able to see the loaded scripts. chrome的“网络”选项卡说在每种情况下GET请求都成功,因此脚本可以很好地加载,并且我能够看到加载的脚本。

This is what I have tried (tabs are made correctly and work fine, but effects don't work) 这就是我尝试过的方法(制表符正确且可以正常工作,但是效果不起作用)

<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js">    </script>

If it matters, I am using Visual Studio 2013, and try fading like below (which seems correct too, as this is what's there in many other answers and working jsfiddles): 如果有问题,我正在使用Visual Studio 2013,并尝试如下所示的淡入淡出(这似乎也是正确的,因为这是许多其他答案和有效的jsfiddles中的内容):

  $(document).ready(function () {
    $(".tabbed-box").tabs({
        fx: {
            opacity: 'toggle'
        }
    });

The only thing I can think of is that I am not including a "complete" jquery-ui script, but this is what the Google hosted libraries page gives me. 我唯一能想到的是,我没有包括“完整的” jquery-ui脚本,但这就是Google托管库页面给我的。 Any ideas are welcome. 任何想法都欢迎。 Thanks! 谢谢!

You can use the hide/show properties to create your animation with jQuery 1.11.1: http://api.jqueryui.com/tabs/#option-show 您可以使用hide / show属性使用jQuery 1.11.1创建动画: http : //api.jqueryui.com/tabs/#option-show

Here is an example: 这是一个例子:

$("#tabs").tabs({ show: { effect: "fade", duration: 800 } });

jsFiddle 的jsfiddle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM