问题描述
我一直在寻找垂直手风琴内容滑块.我找到了一个: http://www.marghoobsuleman.com/jQuery-common-accordion一个>,这是非常好的.我在我的网站 http://www.pixeltrics.com/
I've been searching for a while for a vertical accordion content slider. I've found one: http://www.marghoobsuleman.com/jQuery-common-accordion, and it's pretty good. I implemented it on my site http://www.pixeltrics.com/
但是有些事情我不满意.它不是很平滑,即使我将自动延迟时间设置为4秒,似乎第一张幻灯片切换到第二张幻灯片也要花费更长的时间,然后它们才开始每秒切换一次.所以有些事情是不正确的.
But there are a couple of things I'm not happy with. It's not very smooth, and even though I set the autodelay time to 4 seconds, it seems the first slide takes a lot longer to switch to the second and then they start switching like every second. So something isn't quite right.
有人知道我可以尝试使用另一个垂直手风琴插件吗?理想情况下是一个jQuery.
Does anyone know of another vertical accordion plug-in I can try? Ideally a jQuery one.
谢谢.
推荐答案
为什么仅使用jQuery就很容易使用插件?例子...
Why use a plugin when it's easy enough with jQuery alone? Example...
HTML
<div class="wrap">
<div class="heading">Heading</div>
<div class="body">Body</div>
</div>
<div class="wrap">
<div class="heading">Heading</div>
<div class="body">Body</div>
</div>
<div class="wrap">
<div class="heading">Heading</div>
<div class="body">Body</div>
</div>
jQuery
$(function() {
$('.body').hide();
$('.heading').hover(function() {
$(this).next('.body').stop().slideToggle(500);
$(this).parent().siblings('.wrap').children('.body').stop().slideUp(500);
}, function() {
$(this).next('.body').stop().slideToggle(500);
});
});
这篇关于垂直手风琴内容滑块最好是jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!