Advertisement
Guest User

Untitled

a guest
Sep 18th, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.45 KB | None | 0 0
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3.     <title></title>
  4.     <link href="css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
  5.     <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
  6.   <script type="text/javascript" src="http://code.jquery.com/ui/1.8.18/jquery-ui.min.js"></script>
  7.     <script type="text/javascript">
  8.         $(document).ready(function ()
  9.         {
  10.             var popups = $(".popup");
  11.             popups.dialog({
  12.                 autoOpen: false,
  13.                 draggable: true,
  14.                 title: "Add New Person",
  15.                 open: function(type, data) {
  16.                     $(this).parent().appendTo("#container");
  17.                 }
  18.             });
  19.             $('[data-popup^="pop"]').click(function(e) {
  20.                 e.stopPropagation();
  21.                 $('#' + $(this).data('popup')).dialog("open");
  22.             });
  23.             $('#body1').click(function() {
  24.                 $('.ui-dialog:visible').find('.popup').dialog('close');
  25.             });
  26.         });
  27.     </script>
  28. </head>
  29. <body id="body1">
  30.     <input type="button" data-popup="pop101" value="Popup1" />
  31.     <input type="button" data-popup="pop102" value="Popup2" />
  32.     <input type="button" data-popup="pop103" value="Popup3" />
  33.  
  34.     <div it="container"></div>
  35.    
  36.     <div style="background: green" id='pop101' class="popup"></div>
  37.     <div style="background: orange" id='pop102' class="popup"></div>
  38.     <div style="background: blue" id='pop103' class="popup"></div>
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement