Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('[data-open-modal]').on('click', function(){
- $this = $(this);
- $target= $this.attr('data-open-modal');
- $('body').addClass('open-modal');
- $($target).wrap('<div class="custom-modal-backdrop"></div>');
- $($target).addClass('open');
- $('.custom-modal-backdrop, .close-modal').on('click', function(){
- $('body').removeClass('open-modal');
- $('.custom-modal').removeClass('open').unwrap();
- });
- return false;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement