将滚动添加到GWT SuggestBox [英] Adding scroll to GWT SuggestBox

查看:195
本文介绍了将滚动添加到GWT SuggestBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何:

1)在SuggestBox创建的弹出式窗口中添加滚动条?

1) Add a scroll to the popup created by the SuggestBox?

2)如何有效地自定义SuggestBox的外观(CSS)?

2) How to customize the looks (CSS) of the SuggestBox efficiently?

我想做的上面的更改,而不触及实际的实现尽可能多。
此解决方案应该支持(IE7-IE8,FF,Chrome)。

I want to make above changes without touching the actual implementation as much as possible. Also this solution should support (IE7-IE8, FF, Chrome).

谢谢。

推荐答案

使用Firebug addon for Firefox(或IE / Chrome调试器)来检查您需要修改其样式的元素,并查看GWT是否已为其分配了样式类名称[或读取其JavaDoc] 。这里在你的情况下,它的gwt-SuggestBoxPopup外部元素和许多其他样式类名称为内部元素,如suggestPopupMiddle,suggestPopupMiddleCenterInner和suggestPopupContent。

Use Firebug addon for Firefox (or IE/Chrome debugger) to inspect the element you need to modify its style and see if GWT has assigned it a style class name [or read its JavaDoc]. Here in you case its gwt-SuggestBoxPopup for outer element and lots of other style class names for inner elements like suggestPopupMiddle, suggestPopupMiddleCenterInner and suggestPopupContent. Use this class names to modify components style.

要添加垂直(水平)滚动,您需要指定height(width)或max-height,并使用overflow-y:scroll ; (overflow-x:scroll;)或overflow:scroll;

To add vertical (horizontal) scroll you need to specify height (width) or max-height and use overflow-y: scroll; (overflow-x: scroll;) or overflow: scroll; Use auto instead of scroll to hide the scollbar when not necessary.

因此,您的简短回答是:

So your short answer is:

.suggestPopupContent{
    height: 100px;    
    overflow-y: scroll;
}

这篇关于将滚动添加到GWT SuggestBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆