Created
October 25, 2015 10:21
-
-
Save andrIvash/64cc5c7df4ce20785ba1 to your computer and use it in GitHub Desktop.
popups script
This file contains 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
var Popups = (function(){ | |
var | |
popups = $('.popup'); | |
function _close() { | |
popups.hide(); | |
} | |
return { | |
init: function(){ | |
$('.popup__close, .popup__overlay').on('click', function(e){ | |
e.preventDefault(); | |
_close() | |
}); | |
}, | |
open: function(id) { | |
var | |
reqPopup = popups.filter(id); | |
_close(); | |
reqPopup.fadeIn(300); | |
} | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment