RickStrahl / jquery-resizable

A small jQuery plug-in to make DOM components resizable
MIT License
234 stars 91 forks source link

Mutliple drag handles #24

Closed nickberens360 closed 6 years ago

nickberens360 commented 7 years ago

Greetings, love your plugin and the small footprint! Is it possible to have multiple drag handles like on Google inspect element? image

RickStrahl commented 6 years ago

Yes you can specify multiple splitter handles in the jquery selector or you can provide multiple separate commands to up multiple selectors:

Multiple selectors

 $(".panel-left").resizable({
        handleSelector: ".splitter,.splitter2",
        resizeHeight: false
    });

in this case both splitter and splitter2 are used for handles. This works only if the drag behavior of both is the same.

If you need separate drag behaviors (ie. one vertical one horizontal), then you need two separate resizables:

   // rsize width
   $(".panel-left").resizable({
        handleSelector: ".splitter",
        resizeHeight: false
    });
   // resize height
   $(".panel-left").resizable({
        handleSelector: ".splitter2",
        resizeWidth: false
    });