1

My problem is that i'm having a menubar with a sub menubar (see pic.1) and it always opens on the right side even if there is no space. So my question is how can i change the pop up position? I need the popup to be like in pic.2

Thats how it looks like now:

pic1

Thats how it should look:

pic2

I somehow read that this issue isn't fixed in a current gwt version and that the only way to temporally fix it is to capture the pop up width/height shortly after the creating point and change the position with offsets. Is this true?

Thanks for any help :)

4

1 回答 1

2

尝试给CSS如下:

MenuBar manageMenuBar = new MenuBar(true);
manageMenuBar.setStyleName("dropdownMenu");


.dropdownMenu {
    background-clip: padding-box;
    background-color: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 6px 6px 6px 6px;
    box-shadow: 0 5px 10px #CCCCCC;
    float: right;
    left: -126px; // This will set the position of the menubar at left by 126px.
    list-style: none outside none;
    margin: -6px -18px -20px -5px;
    min-width: 120px;
    padding: 5px 0;
    position: absolute;
    z-index: 1000;
}
于 2013-07-02T11:58:52.293 回答