Vertical Accordion Content Slider ideally jQuery

☆樱花仙子☆ 提交于 2019-12-08 06:44:28

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);

    });
});

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/

hollandben

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!