标记的子菜单项的背景颜色不会更改

时间:2017-08-02 06:56:13

标签: css menu menuitem

我的问题是标记的项目始终具有蓝色背景颜色。但是,我希望父项和标记的子项具有蓝色背景颜色。

我尝试了不同的东西,但没有一个能奏效。 该程序部分用jsp,javascript,gwt和rcp编写。所以我无法调试代码。尽管如此,我找到了问题所在的样式表。 也许有人可以帮助我。 非常感谢你提前。

以下是代码:

    .menu-Menu {
        margin-top: 0px;
        position: absolute;
        border: 1px solid rgb(0, 0, 0);
        background-color: rgb(234, 234, 234);
        color: rgb(0, 0, 0);
    }

    .menu-Menu.vertical {
        background-image: url(../images/bg/some.gif);
        background-repeat: repeat-y;
    }

    .menu-Menu.horizontal {
        background-image: url(../images/bg/horizon.gif);
    }

    .menu-MenuItem {
        white-space: nowrap;
    }

    .vertical .menu-MenuItem {
        padding: 1px;
    }

    .horizontal .menu-MenuItem {
        float:left;
        padding: 2px;
        background-color: rgb(66, 134, 244);
    }

    .menu-MenuItem-active {
        background-color: rgb(66, 134, 244);
        background-image: url(../images/bg/vertical.gif);
        background-repeat: repeat-y;
        background-position: -1px 0px;
        padding-left: 0px;
        margin-left: 0px;
        border: none;
        cursor: pointer;
    }

    .vertical .menu-MenuItem-active, .vertical .menu-MenuItem-active-disabled 
    {
    }

    .horizontal .menu-MenuItem-active, .horizontal .menu-MenuItem-active-
     disabled {
    background-color: inherit;
    background-color: rgb(66, 134, 244);
    }

    .menu-MenuItem-active-disabled {
        border: 1px solid rgb(255, 189, 105);
        background-color: rgb(66, 134, 244);
    }

    .vertical .menu-MenuItem-label {
        padding-left: 16px;
    }

    .horizontal .menu-MenuItem-label {
        background-repeat: no-repeat;
        background-position: right;
    }

    .horizontal .menu-MenuItem-label-padding {
        padding-right: 18px;
    }

    .horizontal .menu-MenuItem-right-panel {
        padding-right: 18px;
    }

    .menu-MenuItem-inactive div,
    .menu-MenuItem-inactive span {
        color: #4286f4;
    }

    .menu-MenuItem-inactive img {
        filter: gray() alpha(opacity=30);
    }

1 个答案:

答案 0 :(得分:0)

我找到了答案。有一个类可以识别鼠标点击,我会执行以下操作:

Element element = DOM.eventGetToElement(event);
element.setPropertyString("xxx", "class");

感谢您的帮助。

相关问题