Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
- <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
- <style>
- #resizable {
- width: 400px;
- height: 200px;
- background-color: white;
- margin: 0px;
- padding: 0px;
- }
- #container {
- background-color: gray;
- width: 600px;
- height: 500px;
- }
- #outsideContainer {
- margin: 0 auto;
- width: 600px;
- height: 500px;
- }
- </style>
- <script>
- $(function() {
- $( "#resizable" ).resizable({
- containment: $('#container')
- });
- $( "#resizable" ).draggable({
- containment: $('#container')
- });
- });
- </script>
- </head>
- <body>
- <div id="outsideContainer">
- <div id="container">
- <div id="resizable" class="ui-widget-content">
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement