问题
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/
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.
Does anyone know of another vertical accordion plug-in I can try? Ideally a jQuery one.
Thanks.
回答1:
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);
});
});
回答2:
There is JQuery UI which is almost the brother of JQuery and it has a lot of useful widgets including an accordion:
http://jqueryui.com/demos/accordion/
回答3:
There's a really cool image and accordion jQuery plugin I developed called Slidorion. it combines an image slider and an accordion so might be what your looking for. Check it out...
http://www.slidorion.com
来源:https://stackoverflow.com/questions/7287541/vertical-accordion-content-slider-ideally-jquery