Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Click close to close modal
- $(".product-modal__close").click(function(){
- $(".product-modal__container").removeClass("active");
- $(".product-modal__content").empty();
- $("body").css("overflow", "visible")
- })
- // Click anywhere but the modal and trigger close modal
- $(".product-modal__container").click( function() {
- $(this).removeClass("active");
- $(".product-modal__content").empty();
- $("body").css("overflow", "visible")
- });
- $(".product-modal__content").click( function(e) {
- e.stopPropagation();
- });
- // Escape Close Modal
- $(document).on('keyup',function(evt) {
- if (evt.keyCode == 27) {
- $(".product-modal__container").removeClass("active");
- $(".product-modal__content").empty();
- $("body").css("overflow", "visible")
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement