Advertisement
Metalskin

jQuery tools overlay

Jan 5th, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.57 KB | None | 0 0
  1. (function($){
  2.     $(document).ready(function() {
  3.  
  4.       var triggers = $(".modalInput").overlay({
  5.         // some mask tweaks suitable for modal dialogs
  6.         mask: {
  7.           color: '#ebecff',
  8.           loadSpeed: 200,
  9.           opacity: 0.9
  10.         },
  11.         closeOnClick: false
  12.       });
  13.  
  14.       $("#prompt form").submit(function(e) {
  15.  
  16.         // close the overlay
  17.         triggers.eq(1).overlay().close();
  18.  
  19.         // get user input
  20.         var input = $("input", this).val();
  21.  
  22.         // do something with the answer
  23.         triggers.eq(1).html(input);
  24.  
  25.         // do not submit the form
  26.         return e.preventDefault();
  27.       });  
  28.     });
  29. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement