admin管理员组文章数量:1279182
Using pure javascript HTML5 and CSS3 (NOT jQuery)
I want to do something like this image, I have HTML elements inside the div, like for example a text area or text box, when user clicks on the container div I want the handles and border to show up. THe user should resize the container only using the handles.
How can I acplish this? I know how to do the events and resize, but not sure how to specifically create the handles and resize only on those points.
Are the handles a CSS trick? or do I have to create a graphic for the container (like a background image on the resizable div container?)
Using pure javascript HTML5 and CSS3 (NOT jQuery)
I want to do something like this image, I have HTML elements inside the div, like for example a text area or text box, when user clicks on the container div I want the handles and border to show up. THe user should resize the container only using the handles.
How can I acplish this? I know how to do the events and resize, but not sure how to specifically create the handles and resize only on those points.
Are the handles a CSS trick? or do I have to create a graphic for the container (like a background image on the resizable div container?)
Share Improve this question edited Jun 14, 2016 at 17:39 sjs asked Jun 14, 2016 at 17:07 sjssjs 4721 gold badge5 silver badges15 bronze badges 9- I want to do ... show what you have tried ... – DaniP Commented Jun 14, 2016 at 17:09
- @DaniP uh, I don't know where to start? everything I found was in jQuery, alternatively I found the way to add standard bottom right hand corner resize handle using css but that's not what I want. – sjs Commented Jun 14, 2016 at 17:15
- 2 I think that you can find the answer of this question here – Dlanor Commented Jun 14, 2016 at 17:16
- What you can do is add a container that provides those points as separate elements, and then bind the events you already know to each point. – DaniP Commented Jun 14, 2016 at 17:19
- 3 It can be CSS .. jsfiddle/0sgun0dr/1 – DaniP Commented Jun 14, 2016 at 17:34
1 Answer
Reset to default 8First you can use CSS like this:
div {
resize: both;
overflow: auto;
}
(http://www.w3schools./cssref/css3_pr_resize.asp);
At this post was a good Javascript example: (How to make HTML element resizable using pure Javascript?)
JS Example:
- https://github./anhr/resizer
本文标签: javascriptHow to create handles on each side of a div for resizing(NO jquery)Stack Overflow
版权声明:本文标题:javascript - How to create handles on each side of a div for resizing? - (NO jquery) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741213294a2359553.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论