“弹出窗口”的名称是什么?在网页上

发布于 2024-08-10 22:47:46 字数 188 浏览 12 评论 0原文

在 amazon.com 和 walmart.com 上,当您将鼠标悬停在部门上时,会出现一个弹出功能。它的工作方式类似于菜单,但悬停时会显示一个带有完整链接列表的实际矩形窗口。

我正在尝试查找该功能的名称。我想知道“弹出”是否合适?第二个问题是否有 jQuery 插件可以做类似的事情。我尝试搜索弹出插件,实际上有一些,但它们似乎不是我想要的。

On amazon.com and on walmart.com there is a flyout feature when you hover over the departments. It works similar to a menu but an actual rectangular window with full lists of links are displayed on hover.

I am trying to find the name of that feature. I wonder of "flyout" is appropriate? And as a second question are there jQuery plugins that do similar things. I tried searching flyout plugins and there are actually a few but they don't seem to be what I want.

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

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

发布评论

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

评论(3

ゞ花落谁相伴 2024-08-17 22:47:46

正如亚历克斯所说...这并不难...事实上,您要做的是 html 中的一个简单列表:

<div id="menu">
    <ul>
        <li>
            <div class="derpartment-title"><a href="#">Item 1</a></div>
            <div class="submenu">
                <ul>
                    <li><a href="#">Item 1.1</li>
                    <li><a href="#">Item 1.2</li>
                    <li><a href="#">Item 1.3</li>
                </ul>
            </div>
        </li>
        <li>
            <div class="derpartment-title"><a href="#">Item 2</a></div>
            <div class="submenu">
                <ul>
                    <li><a href="#">Item 2.1</li>
                    <li><a href="#">Item 2.2</li>
                    <li><a href="#">Item 2.3</li>
                </ul>
            </div>
        </li>
    </ul>
</div>

然后您只需在 CSS 中隐藏 .submenu 类:

.submenu {
    display: none;
}

并使用 jquery 将一个类添加到悬停的列表元素:

$('#menu li').bind('mouseenter',function(){
    $(this).addClass('hovered');
}).bind('mouseleave',function(){
    $(this).removeClass('hovered');
});

然后在你的 CSS 中将相应的属性添加到悬停的子菜单中:

.hovered .submenu {
display: block;
left: 100px /* or the width of the menu or even an auto width, don't know if works with auto */
}

基本上它应该可以使用...然后你只需添加链接、背景等所需的样式属性。

As Alex said... it's not that hard... in fact, what you have to do is a simple list in html:

<div id="menu">
    <ul>
        <li>
            <div class="derpartment-title"><a href="#">Item 1</a></div>
            <div class="submenu">
                <ul>
                    <li><a href="#">Item 1.1</li>
                    <li><a href="#">Item 1.2</li>
                    <li><a href="#">Item 1.3</li>
                </ul>
            </div>
        </li>
        <li>
            <div class="derpartment-title"><a href="#">Item 2</a></div>
            <div class="submenu">
                <ul>
                    <li><a href="#">Item 2.1</li>
                    <li><a href="#">Item 2.2</li>
                    <li><a href="#">Item 2.3</li>
                </ul>
            </div>
        </li>
    </ul>
</div>

Then you just hide the .submenu class in CSS:

.submenu {
    display: none;
}

And with jquery add a class to the hovered list element:

$('#menu li').bind('mouseenter',function(){
    $(this).addClass('hovered');
}).bind('mouseleave',function(){
    $(this).removeClass('hovered');
});

then in your CSS add the respective properties to the hovered submenu:

.hovered .submenu {
display: block;
left: 100px /* or the width of the menu or even an auto width, don't know if works with auto */
}

and basiclly it should work with it... then you just add the style properties you need for links, backgrounds, etc.

牵强ㄟ 2024-08-17 22:47:46

我认为它可能类似于 ASP.NET AJAX HoverMenu

I think it might be similar to the ASP.NET AJAX HoverMenu.

多情出卖 2024-08-17 22:47:46

于是我看了一下网站,发现比我想象的还要简单。

与您在互联网上找到的其他菜单相比,它缺乏特殊的效果和动画。

使用 firebug 快速查看一下,它们将所有内容隐藏并与引用的

  • 元素(使用 CSS 样式化)关联。
    当您将鼠标悬停在菜单项上时,CSS 会从 navSaMenuItemMiddle 更改为 navSaMenuItemMiddleOpen,并且具有绝对位置的 div 会填充菜单项的内容。
  • 该脚本是 ,它是 Amazon.com 的专有权利。

    So I took a look at the website and it is even easier than I thought.

    Compared to other menus you can find in the internet, this lacks particular effects and animations.

    Having a quick look with firebug, they keep all the content hidden and associated to the referring <li> element (styled with CSS).
    When you over with the mouse to a menu item, the CSS changes from navSaMenuItemMiddle to navSaMenuItemMiddleOpen and a div with absolute position is filled with the content of the menu item.

    The script is this, and it is proprietary of Amazon.com.

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