Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('[data-open-modal]').on('click', function(){
  2.     $this = $(this);
  3.     $target= $this.attr('data-open-modal');
  4.  
  5.     $('body').addClass('open-modal');
  6.     $($target).wrap('<div class="custom-modal-backdrop"></div>');
  7.     $($target).addClass('open');
  8.  
  9.     $('.custom-modal-backdrop, .close-modal').on('click', function(){
  10.       $('body').removeClass('open-modal');
  11.       $('.custom-modal').removeClass('open').unwrap();
  12.     });
  13.  
  14.     return false;
  15.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement