Skip to content

Instantly share code, notes, and snippets.

@RuslanHolovko
Created October 15, 2019 08:16
Show Gist options
  • Save RuslanHolovko/0e1a681b6ba306fb7ca52c53fd38e171 to your computer and use it in GitHub Desktop.
Save RuslanHolovko/0e1a681b6ba306fb7ca52c53fd38e171 to your computer and use it in GitHub Desktop.
Slide toggle, check if slide is open
$(document).on('click', '.mobile_phones-box', function() {
$('.phone').slideToggle(400, function (){
if ($(this).is(':hidden')) {
console.log("closed");
} else {
$('body, html').animate({ scrollTop: 0 }, 300);
console.log("open");
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment