Created
January 25, 2018 07:15
-
-
Save KaiserEMP/966e900968b7f1a8426fd86b7c61e4e2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 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'); | |
| }); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment