gpt4 book ai didi

jquery - 创建一个随着窗口缩小但隐藏左侧内容的面包屑

转载 作者:太空宇宙 更新时间:2023-11-03 19:14:39 25 4
gpt4 key购买 nike

我需要制作一个面包屑导航,它可能会很长,随着小屏幕的窗口缩小,但其中的链接会向左消失,即最近访问的页面始终在 View 中,CSS 中的百分比宽度不工作,所以想 JQuery。

最佳答案

只需结合使用 direction: rtl;overflow: hidden;。例如,试试这个示例代码 ( demo )。

HTML

<div id="breadcrumb">
<a href="#">Home</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Page</a> &gt;
<a href="#">Parent</a> &gt;
Current Page
</div>

CSS

#breadcrumb {
overflow: hidden;
direction: rtl;
white-space: nowrap; /* keeps everything on one line */
width: 50%; /* change this to whatever you want (for example, 300px) */
}

关于jquery - 创建一个随着窗口缩小但隐藏左侧内容的面包屑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7147864/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com