简体   繁体   English

通过拖动div的边缘水平调整div的大小

[英]Horizontally resize the div by dragging an edge of div

I have an application built using angular2 and my web page content is divided into two panels as columns. 我有一个使用angular2构建的应用程序,我的网页内容分为两个面板作为列。 I need to implement a functionality to be able to resize both panels by selecting either right edge of left panel or by selecting left edge of right panel. 我需要实现一种功能,通过选择左侧面板的右边缘或右侧面板的左边缘来调整两个面板的大小。

Please let me know if there is a way to achieve this using angular or html,css or javascript. 请让我知道是否有一种方法可以使用angular或html,css或javascript实现。

I know css3 has resize property but this allows you to resize by holding one corner of div and not looking for this feature 我知道css3具有resize属性,但是这允许您通过握住div的一个角而不查找该功能来调整大小

Example: I want to implement similar functionality as w3schools HTML editor ( https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default ) 示例:我想实现与w3schools HTML编辑器( https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default )类似的功能

If we open above url we can resize both left and right panels by dragging the middle bar horizontally. 如果我们在网址上方打开,则可以通过水平拖动中间栏来调整左右面板的大小。 Please refer below screenshot 请参考下面的截图

在此处输入图片说明

Take a look at Resizable jQuery , for example: 看一下Resizable jQuery ,例如:

$("#div1").resizable({
    handles: 'e, w'
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM