KaiserEMP
1/25/2018 - 7:15 AM

ContactList Clone Hide

  /* Contact list */

  $('.contact-list .contact-single .contact-name, .contact-list .contact-single .show_content').click(function(e){
    e.preventDefault();
    var button = $(this);
    var element = $(this).closest('.contact-single');
    var details = element.find('.contact-detailed').clone(true);
    $('.contact-list .contact-single').removeClass('open');
    element.addClass('open');
    if (details.length) {
      if ($( window ).width() >= 768) {
        $('.contact-list-row').find('> .contact-detailed').remove();
        element.parent().append(details);
        $('html, body').animate({
            scrollTop: element.offset().top - 30
        }, 400);
        $('.detail-close').click(function(){
          var a = $(this).closest('.contact-detailed');
          a.remove();
          $('.contact-list-row .contact-single').removeClass('open');
        });
      } else {
        $('.detail-close').click(function(){
          var a = $(this).closest('.contact-detailed');
          $('.contact-list-row .contact-single').removeClass('open');
        });
      }
    }
  });