ASP.NET 动态子菜单在出现滚动箭头时截断文本

发布于 2024-12-13 08:03:25 字数 242 浏览 0 评论 0原文

我有一个动态子菜单,可以在后面的代码中以编程方式构建。每当添加大量项目时,滚动箭头似乎允许滚动子菜单,但当它出现时,它似乎也会截断菜单文本,因为子菜单宽度的大小不正确以适应文本。

问题不在于滚动本身;而在于滚动本身。这正在按照我想要的方式工作。问题在于菜单宽度被缩短,当为大菜单显示滚动箭头时,这会截断菜单文本。

这个问题似乎是在IE7中出现的,因为它在IE6中工作正常,菜单的宽度大小适合文本。以前有人经历过这种情况吗?你是如何解决的?

I have a dynamic sub-menu that gets programmatically constructed in the code behind. Whenever a large amount of items are added, the scroll arrow appears to allow scrolling of the sub-menu, but when it does appear, it also seems to truncate the menu text because the sub-menu width is not correctly sized to accommodate the text.

The problem is not the scrolling itself; that is working the way I want it to. The problem is that the menu width is shortened and this is truncating the menu text when the scrolling arrows are presented for large menus.

This problem seems to be in IE7, because it is working fine in IE6, the width of the menu is of the appropriate size to fit the text. Has anyone experienced this before and how did you fixed it?

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

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

发布评论

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

评论(1

旧情别恋 2024-12-20 08:03:25

您可以将菜单包装在 div 中并在其上设置溢出:滚动,但这适用于整个菜单,而不是下拉部分。您无法更改标准菜单上的下拉部分,但如果使用 CSS 适配器 (http://www.asp.net/cssadapters/),您可以更改下拉部分的大小和滚动功能。然而,这提供了标准的滚动 - 您会在该部分周围看到一个滚动条,并且您必须手动滚动,这确实不是一个很好的体验。您可能想要的是在顶部/底部提供一个箭头,以便当您将鼠标悬停在其上时可以滚动,从而将项目带入视图;如果不重写菜单控件,就无法完成此操作。如果您需要此功能,您最好查看第三方菜单控件,甚至可能有某些功能的 ajax 框架之一。 jQuery...

you can wrap the menu in a div and set overflow:scroll on that, but that applies to the entire menu, not the drop-down part. You can't change the drop down part on the standard menu, but it you use the CSS Adapters (http://www.asp.net/cssadapters/) you can change the size and scroll capabilities of the drop-down parts. However, this gives the standard scrolling - you see a scroll bar around the section and you have to scroll manually, it's really not a very nice experience. What you probably want is something that gives an arrow at the top/bottom to allow scrolling as you hover over it, to bring the items into view; this cannot be done without rewriting the menu control. If you need this functionality you might be best to look at a third party menu control, or even one of the ajax frameworks which might have something. jQuery...

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