Resizable and draggable box, scrolling problem in the container
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>jQuery UI Draggable - Handles</title>
- <link rel="stylesheet" href="http://jqueryui.com/themes/base/jquery.ui.all.css">
- <script src="http://jqueryui.com/jquery-1.4.4.js"></script>
- <script src="http://jqueryui.com/ui/jquery.ui.core.js"></script>
- <script src="http://jqueryui.com/ui/jquery.ui.widget.js"></script>
- <script src="http://jqueryui.com/ui/jquery.ui.mouse.js"></script>
- <script src="http://jqueryui.com/ui/jquery.ui.draggable.js"></script>
- <script src="http://jqueryui.com/ui/jquery.ui.resizable.js"></script>
- <style>
- #draggable2 { width: 200px; height: 200px; float: left; }
- #container {
- position: relative;
- float:left;
- border: 3px #000 solid;
- overflow:scroll;
- width: 50%;
- height: 350px;
- background-color:#FFFFFF;
- }
- </style>
- <script>
- $(function() {
- $( "#draggable2" ).draggable();
- $( "#draggable2" ).resizable();
- $( "div, p" ).disableSelection();
- });
- </script>
- </head>
- <body>
- <div id="container">
- <div style=" background-color:#FFF" id="draggable2" class="ui-widget-content">
- Box
- </div>
- </div>
- </body>
- </html>
This is my code, Change the box position. When the scroll bar appear, resize the box and you'll see scroll bar disappeared.
How can i fix this ?
Thanks.