How to resize ONLY horizontally or vertically with jQuery UI Resizable?

前端 未结 7 2275
长情又很酷
长情又很酷 2020-12-12 23:29

The only solution I\'ve found is to set the max and min height or width with the current value.

Example:

foo.resizable({ 
  maxHeight: foo.height(),          


        
7条回答
  •  误落风尘
    2020-12-13 00:12

    A very simple solution:

    $( ".selector" ).resizable({ grid: [1, 10000] }); // horizontal
    $( ".selector" ).resizable({ grid: [10000, 1] }); // vertical
    

    This works for draggable() as well. Example: http://jsfiddle.net/xCepm/

提交回复
热议问题