如何调整 DOM 元素的高度?
我的用户界面中有一个小部件,位于浏览器右下角的固定位置。
我希望用户能够单击小部件的标题部分并能够向上拖动它并有效地增加小部件的高度。小部件的底部、左侧和右侧属性将保持不变,但顶部应该能够更改以允许达到由 css max-height 定义的小部件的最大高度。
那里有类似的例子吗?我知道 jQueryUI 具有可调整大小的行为,但不幸的是我无法在这个项目上使用 jQueryUI。然而我们正在使用 jQuery。
任何提示、想法或 jsfiddle 示例都将不胜感激。只是让我朝着正确的方向前进的东西。我查看了 CSS3 可调整大小,它将标准调整大小图标放在右下角,就像这个文本区域一样。
I have a widget in my ui that resides in a fixed location on the right bottom corner of my browser.
I want the user to be able to click on the header portion of the widget and be able to drag it upwards and effectively increase the height of the widget. The widgets bottom, left, and right properties would be unchanged but top should be able to change to allow up to the max height of the widget as defined by it's css max-height.
Are there any examples of something like this out there? I know jQueryUI has the resizable behavior but unfortunately I cannot use jQueryUI on this project. We are however using jQuery.
Any tips or ideas or jsfiddle exaples are greatly appreciated. Just something to get me going in the right direction. I looked a CSS3 resizable and it puts that standard resizing icon in the right bottom corner, like this textarea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许这个插件可以提供帮助?
http://dev.iceburg.net/jquery/jqDnR/
Perhaps this plugin can help?
http://dev.iceburg.net/jquery/jqDnR/
仅使用 jQuery 就可以做到这一点。在我的脑海里,你可能会做这样的事情:
It is possible to do this with just jQuery. Off the top of my head, you could probably do something like this: