实现div控件拖拽调整位置和大小
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Resizable - Default functionality</title> <link rel="stylesheet" href="jquery-ui.css"> <style> #dd { width: 150px; height: 150px; padding: 0.5em; } #dd h3 { text-align: center; margin: 0; } </style> <style> #dd { width: 150px; height: 150px; padding: 0.5em; } </style> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script> $( function() { $( "#dd" ).draggable(); $( "#dd" ).resizable(); } ); </script> </head> <body> <div id="dd" class="ui-widget-content"> <table border=1> <tr> <td>aaa</td><td>aaa</td> </tr> <tr> <td>aaa</td><td>aaa</td> </tr> <tr> <td>aaa</td><td>aaa</td> </tr> <tr> <td>aaa</td><td>aaa</td> </tr> <tr> <td>aaa</td><td>aaa</td> </tr> <tr> <td>aaa</td><td>aaa</td> </tr> <tr> <td>aaa</td><td>aaa</td> </tr> <tr> <td>aaa</td><td>aaa</td> </tr> </table> </div> </body> </html>