admin管理员组

文章数量:1391974

How would I let a user resize a div? I would like them to be able to grab the side of it and pull it, I DO NOT want CSS Resize property. The Resize property makes the part you drag to make it bigger in the corner. So how would I let a user make a div bigger by grabbing the side?

How would I let a user resize a div? I would like them to be able to grab the side of it and pull it, I DO NOT want CSS Resize property. The Resize property makes the part you drag to make it bigger in the corner. So how would I let a user make a div bigger by grabbing the side?

Share Improve this question edited Feb 19, 2015 at 23:05 ZEE 5,8794 gold badges39 silver badges54 bronze badges asked Feb 19, 2015 at 21:56 michael jonesmichael jones 7401 gold badge8 silver badges17 bronze badges 1
  • 2 you may want to add javascript to your question tags – Justin Breiland Commented Feb 19, 2015 at 21:59
Add a ment  | 

1 Answer 1

Reset to default 3

If you don’t want to use the resize property, there’s no other option to do this with CSS. However, you can achieve this with JavaScript.

There are libraries that support this, e.g. jQuery UI: http://jqueryui./resizable/

Of course, it’s also possible to do this in plain JavaScript. However, it’s tricky due to differences in the browser’s implementations. How to make HTML element resizable using pure javascript? might be a good starting point.

本文标签: javascriptHow to resize div with CSS by the borderStack Overflow