Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. ;(function ($, window, document) {
  2.  
  3. $(function () {
  4.  
  5. $('[data-accordion]').each(function () {
  6. var $accordion = $(this);
  7.  
  8. $('.accordion__title').on('click', function () {
  9. if ($(this).next().is(':visible')) {
  10. $(this).next().slideUp(300);
  11. return;
  12. }
  13. $accordion.find('.accordion__content').stop().slideUp(300);
  14. $(this).next().stop().slideDown(300);
  15. })
  16. })
  17.  
  18. })
  19.  
  20.  
  21. })(jQuery, window, document)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement