由于某些原因,我无法使用我的jQuery UI选项卡中的任何动画。我已经尝试了here中的许多示例,但都没有成功。
下面是我如何布置我的选项卡。
<div id="tabs">
<ul class="tabsHeader">
<h1>PARTNERSHIPS</h1>
<li><a href="#tabs-1"><span class="toothIcon"></span>The Benefits</a></li>
<li><a href="#tabs-2"><span class="avatarIcon"></span>Join Us</a></li>
</ul>
<div class="clearfix"></div>
<div id="tabs-1">
<div class="content">
<h1>header</h1>
<ul>
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
<li>text</li>
</ul>
</div>
</div>
<div id="tabs-2">
<div class="content">
<p>some text</p>
<form>
<input type="text" name="name" placeholder="NAME" />
<input type="text" name="email" placeholder="EMAIL" />
<input type="text" name="phone" placeholder="PHONE" />
<input type="text" name="city" placeholder="CITY OF PRACTICE" />
<input type="submit" />
</form>
</div>
</div>
</div>像这样初始化:
$('#tabs').tabs({ fxFade: true, fxSpeed: 'fast' });或
$( "#tabs" ).tabs({ hide: { effect: "explode", duration: 1000 } });选项卡按预期方式工作,但没有动画?有人知道为什么吗?
发布于 2013-04-12 00:50:27
您正在使用旧的API文档。检查此http://api.jqueryui.com/tabs/#option-hide
你需要使用hide和show属性来定义动画,而不是fxFade等。
发布于 2013-04-12 00:51:27
使用jQuery标签的hide option和show option来制作动画。
您可以使用boolean、number、string或object来执行此操作。
布尔值:
当设置为true时,面板将使用默认持续时间和默认缓动淡入。
$('#tabs').tabs({
hide: true,
show: false
});演示:http://jsfiddle.net/dirtyd77/ppgH9/5/
号(毫秒):
面板将以指定的持续时间和默认缓动淡入。
$('#tabs').tabs({
hide: 1000,
show: 2000
});演示:http://jsfiddle.net/dirtyd77/ppgH9/6/
字符串:
该值可以是内置jQuery动画方法的名称,如"slideDown",也可以是jQuery UI效果的名称,如"fold“。在任何一种情况下,效果都将与默认持续时间和默认缓动一起使用。
$('#tabs').tabs({
hide: 'fade',
show: 'explode'
});演示:http://jsfiddle.net/dirtyd77/ppgH9/4/
对象:
如果该值是对象,则可以提供效果、延迟、持续时间和缓动属性。
$('#tabs').tabs({
hide: { effect: "fade", duration: 200 },
show: { effect: "fade", duration: 200 }
});https://stackoverflow.com/questions/15954278
复制相似问题