Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery ui resizable left-bottom handle to resize

I am using jquery-ui-resizable plugin in my project.

By default when you make a DOM Object jquery-ui-resizable the resizable handle will appear on right-bottom corner, I need the re-sizable handle on left-bottom corner.

--- EDIT ---

One more thing, it should not be re-sizable using right border but should be re-sizable using left border.

enter image description here

like image 878
Imran Naqvi Avatar asked Jul 29 '11 10:07

Imran Naqvi


3 Answers

You should use the handles

supported: { n, e, s, w, ne, se, sw, nw }. 

This will create the Handles on the side you specified. Default values are

'e, s, se'

Code examples

Initialize a resizable with the handles option specified.

$( ".selector" ).resizable({ handles: 'n, e, s, w' });

Get or set the handles option, after init.

//getter
var handles = $( ".selector" ).resizable( "option", "handles" );
//setter
$( ".selector" ).resizable( "option", "handles", 'n, e, s, w' );
like image 154
Talha Ahmed Khan Avatar answered Nov 10 '22 19:11

Talha Ahmed Khan


Additional to Ahmed's answer: jQueryUI doesn't include a icon for the sw-handle and also doesn't apply a icon-class for the sw-handle. You may use some CSS to add an icon:

#resizable .ui-resizable-sw{background:url(path/to/custom_icon.gif) no-repeat;}
like image 38
Dr.Molle Avatar answered Nov 10 '22 21:11

Dr.Molle


To do re-sizing from all sides following code can also be used

     var resizeOpts = { 
      handles: "all" ,autoHide:true
    }; 
$( ".selector" ).resizable(resizeOpts);

and autoHide equal true means that grip icon will automatically hide when mouse pointer is taken away from dom object.

like image 7
Ali Nouman Avatar answered Nov 10 '22 21:11

Ali Nouman