Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize Element with box handles in corners

in Jcrop , after selecting cropping area , a div appears with box handles in corners.

Is there any jQuery plugin that can build this type of box handles ?

like image 846
Mironline Avatar asked Jul 11 '12 08:07

Mironline


1 Answers

You can use jQuery UI's resizable as noted above. I even setup a fiddle for ya!

http://jsfiddle.net/digitalaxis/j2JU6/

jQUERY

$('#element').resizable({
    handles: {
    'ne': '#negrip',
    'se': '#segrip',
    'sw': '#swgrip',
    'nw': '#nwgrip'
    }
});

HTML

<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>

CSS

#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;
}
like image 180
Randy Gonzalez Avatar answered Sep 16 '22 19:09

Randy Gonzalez