SHARE
TWEET

Untitled

a guest Sep 26th, 2013 142 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  6. <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  7. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  8. <style>
  9. #resizable {
  10.   width: 400px;
  11.   height: 200px;
  12.   background-color: white;
  13.   margin: 0px;
  14.   padding: 0px;
  15. }
  16.  
  17. #container {
  18.   background-color: gray;
  19.   width: 600px;
  20.   height: 500px;
  21. }
  22.  
  23. #outsideContainer {
  24.   margin: 0 auto;
  25.   width: 600px;
  26.   height: 500px;
  27. }
  28. </style>
  29. <script>
  30. $(function() {
  31.   $( "#resizable" ).resizable({
  32.     containment: $('#container')
  33.   });
  34.  
  35.   $( "#resizable" ).draggable({
  36.     containment: $('#container')
  37.   });
  38. });
  39.  
  40. </script>
  41. </head>
  42. <body>
  43.   <div id="outsideContainer">
  44.   <div id="container">
  45.     <div id="resizable" class="ui-widget-content">
  46.     </div>
  47.   </div>
  48.   </div>
  49. </body>
  50. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top