使用 GWT 溢出到滚动条和下一个面板的右侧

发布于 2024-11-09 13:03:33 字数 339 浏览 0 评论 0原文

我有一个 GWT 应用程序,它有一个带有目录树的左侧可滚动导航面板。我希望能够通过底部的滚动条(我有)来保持面板狭窄,但在悬停时显示整个文件名,溢出垂直滚动条并进入下一个面板。我可以通过在悬停时用全名覆盖一个小 div 来做到这一点,但这看起来很笨拙,并且容易出现微妙的视觉错误。我尝试过调整可见性、换行和 z 索引,但没有效果。我可以通过调整相关项目的 CSS 参数或其他一些不那么笨拙的方式来做到这一点吗?

IntelliJ 以正确的方式执行此操作,但它们不在浏览器中:

在此处输入图像描述

谢谢, -拉尔斯

I have a GWT application that has a left-hand scrollable navigation panel with a directory tree. I would like to be able to keep the panel narrow with a scroll bar at the bottom (which I have) but show the entire file name on hover, overflowing over the vertical scrollbar and into the next panel. I could do it by overlaying a small div with the full name when hovering, but that seems klugey and prone to subtle visual errors. I've tried fiddling with visibility, wrap and z-index with no effect. Can I do this by just adjusting the CSS parameters of the item in question, or on some other not-so-klugey way?

IntelliJ does this in the right way, but they're not in a browser:

enter image description here

Thanks,
-Lars

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

贩梦商人 2024-11-16 13:03:33

我认为你必须使用覆盖层。如果标签位于 div 内,则该 div 将控制溢出,并且无法为不同的子项指定不同的溢出值。

您可以在运行时将标签中的所有样式复制到新的覆盖 div 上,以避免重复所有样式。我可能会放弃仅在溢出周围(在示例图片中的“esponse”周围)设置轮廓框。这似乎很难。

I think you'll have to go with an overlay. If the labels are inside a div then that div will control the overflow, and there's no way to specify different overflow values for different children.

You could copy all of the styles from your label onto your new overlay div at runtime to avoid having to duplicate all your styling. I'd probably give up on having the outline box only around the overflow (around "esponse" in your example picture). That seems hard.

左岸枫 2024-11-16 13:03:33

不幸的是,它不能在 HTML 中完成。根据规范

'overflow-x' 和 'overflow-y' 的计算值与其指定值相同,但某些与 'visible' 的组合是不可能的:如果一个被指定为 'visible',而另一个被指定为'scroll' 或 'auto',然后 'visible' 设置为 'auto'。

Unfortunately, It can't be done in HTML. according to the spec..

The computed values of ‘overflow-x’ and ‘overflow-y’ are the same as their specified values, except that some combinations with ‘visible’ are not possible: if one is specified as ‘visible’ and the other is ‘scroll’ or ‘auto’, then ‘visible’ is set to ‘auto’.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文