Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $('.accordion__trigger').on('click', function(e){
- e.preventDefault();
- var $this = $(this),
- item = $this.closest('.accordion__item'),
- list = $this.closest('.accordion__list'),
- items = list.find('.accordion__item'),
- content = item.find('.accordion__inner'),
- otherContent = list.find('.accordion__inner'),
- duration = 300;
- if (!item.hasClass('.active')){
- item.removeClass('active');
- item.addClass('.active');
- otherContent.stop(true, true).slideUp(duration);
- content.stop(true, true).slideDown(duration);
- } else {
- content.stop(true, true).slideUp(duration);
- item.stop(true, true).removeClass('.active');
- }
- })
- })
Add Comment
Please, Sign In to add comment