У меня очередной вопрос про resizable. Мне нужно сделать вот так
 То есть, чтобы возле объекта, размер которого меняется, были "квадратики" для изменени размера. Вот я http://jsfiddle.net/digitalaxis/j2JU6/ в интернете скрипт. Вот он весь целиком
| Код |
<html> <head> <link rel="stylesheet" href="jquery-ui-1.10.2/themes/base/jquery-ui.css" /> <script src="jquery-1.9.1.min.js"></script> <script src="jquery-ui-1.10.2/ui/jquery-ui.js"></script> <title>border</title> <script type="text/javascript"> $(function() {
$('#elementResizable').resizable({ handles: { 'ne': '#negrip', 'se': '#segrip', 'sw': '#swgrip', 'nw': '#nwgrip' } });
}); </script> <style>
#elementResizable { border: 1px solid #000000; width: 300px; height: 40px; overflow: hidden; } #nwgrip, #negrip, #swgrip, #segrip, #ngrip, #egrip, #sgrip, #wgrip { width: 10px; height: 10px; background-color: #ffffff; border: 1px solid #000000; } #segrip { right: -5px; bottom: -5px; }
</style> </head> <body> <div id='elementResizable'> <h1>Full Name</h1> Title <div class="ui-resizable-handle ui-resizable-nw" id="nwgrip"></div> <div class="ui-resizable-handle ui-resizable-ne" id="negrip"></div> <div class="ui-resizable-handle ui-resizable-sw" id="swgrip"></div> <div class="ui-resizable-handle ui-resizable-se" id="segrip"></div> </div </body> </html>
|
В результате получается
 Мне нужно сделать так, чтобы "квадратики" были как на первом изображении - не только в углах, но и по середине border'а.
Я открыл api jquery ui и начал искать как это сделать
| Цитата | String: A comma delimited list of any of the following: n, e, s, w, ne, se, sw, nw, all. The necessary handles will be auto-generated by the plugin. Object:
The following keys are supported: { n, e, s, w, ne, se, sw, nw }. The value of any specified should be a jQuery selector matching the child element of the resizable to use as that handle. If the handle is not a child of the resizable, you can pass in the DOMElement or a valid jQuery object directly.
|
Я так понял, что нужно использовать "хандлы" n, e ,s ,w И вот как я изменил скрипт(часть изменений выделены жирным(желтым) , другая часть(то что в body) почему то не выделилась)
| Код | <html> <head> <link rel="stylesheet" href="jquery-ui-1.10.2/themes/base/jquery-ui.css" /> <script src="jquery-1.9.1.min.js"></script> <script src="jquery-ui-1.10.2/ui/jquery-ui.js"></script> <title>border</title> <script type="text/javascript"> $(function() {
$('#elementResizable').resizable({ handles: { 'n': '#negrip', 'e': '#segrip', 's': '#swgrip', 'w': '#nwgrip' } });
}); </script> <style>
#elementResizable { border: 1px solid #000000; width: 300px; height: 40px; overflow: hidden; } #nwgrip, #negrip, #swgrip, #segrip, #ngrip, #egrip, #sgrip, #wgrip { width: 10px; height: 10px; background-color: #ffffff; border: 1px solid #000000; } #segrip { right: -5px; bottom: -5px; }
</style> </head> <body> <div id='elementResizable'> <h1>Full Name</h1> Title <div class="ui-resizable-handle ui-resizable-n" id="nwgrip"></div> <div class="ui-resizable-handle ui-resizable-e" id="negrip"></div> <div class="ui-resizable-handle ui-resizable-s" id="swgrip"></div> <div class="ui-resizable-handle ui-resizable-w" id="segrip"></div> </div> </body> </html>
|
получилось всё-равно не то

Помогите, пожалуйста, сделать как на первом скрине(зелёном квадрате) |