Search code examples
jqueryjquery-uidrag-and-dropjquery-resizable

Jquery custom resize handle is not working


I want handles on an realizable object similar to the following image.

The code i tried did not work with custom handles.

if i include the custom handle option the re-size do not work at all.

<style>
    .object{
        width: 100px; height: 100px; border: 1px solid black;

}
#myContainer{
    height: 600px;
    border: 2px solid #ccc;
}
.handle{
    height: 10px; width: 10px; background: red;
}
</style>
<script type="text/javascript">
$(function() {
    $("#resizable").resizable({
        handles: { 'all': $('#handle') }
      });
});
</script>

<div id="myContainer">
    <div class="object" id="resizable">
        <div id="handle" class="handle"></div>
    </div>
</div>

enter image description here


Solution

  • Have you seen http://jqueryui.com/demos/resizable/ ?

    You could add some code to change the border of the div to a dotted border and use background images for the eight squares?