jQuery UI显示/隐藏幻灯片效果 - 如何更改幻灯片"后退"速度

Dav*_*ave 8 jquery jquery-ui

我的页面包含许多OL列表,每个列表都显示一系列链接.单击每个链接时,内容向右滑出.点击每个链接时,内容然后重新滑入,然后再次滑出.

这是一个小提琴,展示了这一点:

http://jsfiddle.net/juxprose/xu3ck/15/

I would like to slow down the "back-in" part of the slide effect, so it matches the speed of the slide-out. You'll see currently it slides back-in very quickly - I'd like to adjust this speed.

Here's the JS part of the code, where the action happens:

$('.trg-open.website-title').click(function (e) {
 e.stopPropagation();
 $('.website-info').hide();
 $(this).next('.website-info').show('slide', {direction: 'left'}, 1400);
});
Run Code Online (Sandbox Code Playgroud)

Any pointers gratefully appreciated, thanks.

Sus*_* -- 12

试试这个,而不是隐藏它

$(document).ready(function(){
    $('.trg-open.website-title').click(function (e) {
    e.stopPropagation();
    $('.website-info').hide('slide', {direction: 'left'}, 1400);
    $(this).next('.website-info').stop().show('slide', {direction: 'left'}, 1400);
   });
});
Run Code Online (Sandbox Code Playgroud)

检查小提琴


Bal*_*ako 5

怎么样$('.website-info').hide(1400)?这将隐藏它与你展示的东西完全相同的速度.