Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*----------------------------------------
- MODAL
- ----------------------------------------*/
- // JS:
- $(document).ready(function() {
- $('.open-window').click(function() { // <- trigger (.open-window)
- $('.modal-window').fadeIn(function() { // <- overlay fadeIn
- $('.window-container').addClass('visible'); // <- modal window show
- $('body').css('overflow', 'hidden'); // <- can't scroll while modals are showing up (optional).
- });
- });
- $('.btn-close, .modal-window').click(function() { // <- close triggers
- $('.modal-window').fadeOut().end().find('.window-container').removeClass('visible'); // <- overlay fadeOut, modal hide
- $('body').css('overflow', 'visible'); // <- can scroll our page again
- });
- $('.window-container').click(function(event) {
- event.stopPropagation()
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement