1

这是一个有趣的。

CSS:

    #menu>li>a:link, #menu>li>a:visited {
        color:#002349;
        display: block;
        float: left;
        width: auto;
        font-weight: 500;
        font-size: 18px;
        text-decoration:none;
        text-transform: lowercase;
        padding: 10px 10px;
    }

    #menu>li:hover>a {
        color:#fff;
        text-decoration: none;
        background-color: #002349;
    }

.submenu {
    position:absolute;
    left: -9999px;
    padding:0px 0px 0px 0px;
    top:32px;
    margin: 0px;
    text-align: left;
    background-color: #002349;
    width: auto;
    z-index: 20;
}

#menu li:hover .submenu {
    display:block;
    position: absolute;
    left:0px;
}

.submenu li {
    text-align: left !important;
    margin:0px 0px 0px 0px !important;
    padding: 0px;
    display:block;
    clear:both;
}

.submenu li a:link, .submenu li a:visited {
    color:#fff !important;
    font-size: 12px;
    margin: 0px;
    padding:5px 12px 7px 12px !important;
    margin: 0px !important;
    display: block;
    text-transform: uppercase;
    white-space: nowrap;
}

.submenu li a:hover, .submenu li a:active {
    color:#fff !important;
    background: #666 !important;
    text-decoration: none;
}

的HTML:

<ul id="menu">
    <li><a href="http://jamie.brixwork.com/why-jamie-realtor" title="Meet Jamie MacDougall">why jamie</a>
    </li>
    <li><a href="http://jamie.brixwork.com/why-sothebys" title="Why Sotheby's International?">why sotheby's</a>
    </li>
    <li><a href="http://jamie.brixwork.com/listings" title="Featured Real Estate Listings">featured listings</a>
        <ul class="submenu">
            <li><a href="http://jamie.brixwork.com/listings/pageid-8/city-North+Vancouver/page-1" title="Featured Real Estate Listings">North Vancouver</a></li>
            <li><a href="http://jamie.brixwork.com/listings/pageid-9/city-West+Vancouver/page-1" title="Featured Real Estate Listings">West Vancouver</a></li>
        </ul>
    </li>
</ul>

你可以在这里看到整个页面:http: //jamie.brixwork.com/why-sothebys

用鼠标浏览“列表”菜单。如果您的鼠标退出 UPWARDS 或 SIDEWAYS,则原始文本颜色(深蓝色)会恢复。

但是,如果您进入下拉菜单 (),然后通过将鼠标向下移出子菜单来退出,则顶部菜单的文本颜色不会变回。

为什么会这样?我有:悬停在顶部

  • 标记,因为我希望悬停效果在子菜单悬停时对顶部菜单项生效,因此我不能仅将悬停效果放在顶部菜单的标签上。

  • 4

    1 回答 1

    1

    https://github.com/sorccu/cufon/wiki/FAQ#wiki-faq-10

    事实证明,这是一个 CUFON 问题,检测已关闭。FAQ #10 有答案.. 虽然我什至不明白这意味着什么。:(但是从他们的示例中复制粘贴一个片段解决了它。

    我将 CUFON 替换代码更改为:

    Cufon.replace('#menu>li', { fontFamily: 'gillsans', hover:true,
    hoverables: { li: true },
        ignore: { ul: true },
        textless: { li: true }
    });
    
    于 2012-08-23T23:09:21.007 回答