Skip to content

Instantly share code, notes, and snippets.

@Buzovskiy
Created November 28, 2020 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Buzovskiy/3004410f1c66f1b12baa44f582378a95 to your computer and use it in GitHub Desktop.
Save Buzovskiy/3004410f1c66f1b12baa44f582378a95 to your computer and use it in GitHub Desktop.
jquery dialog window button
init_social_button : function(){
let button = $(".social-top .social-button");
let dialogWindow = $(".social-top ul");
button.click(function(e){
button.toggleClass("active");
dialogWindow.toggle();
});
$(".social-top").click(function(e){
e.stopPropagation();
})
$(document).click(function(){
if (dialogWindow.is(":visible") && window.screen.width < 850) {
dialogWindow.toggle();
button.toggleClass("active");
}
})
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment