如何才能完成这个topmenu

时间:2018-04-20 10:18:05

标签: javascript

所以我一直试图找到与此页面上的topnav菜单类似的内容:https://www.apotekhjartat.se/

不确定这是纯css,javascript还是一些jquery。 (猜它叫做/被称为切换或隐藏/显示div)

如果打开或关闭内容并且内容向下滑动,我喜欢显示箭头的方式。

如果我看一下w3schools上的例子,我只能发现它适用于一个链接...... https://www.w3schools.com/howto/howto_js_toggle_hide_show.asp

简单标记:



<header>
    <ul>
        <li><a href="#">This is my first link</a></li>
        <li><a href="#">This is my second link</a></li>
        <li><a href="#">This is my third link</a></li>    
    </ul>    
</header>
    
    
<section id="01" style="display: none">
    <p>This is the conent of the first link</p> 
</section>
    
<section id="02" style="display: none">
    <p>This is the conent of the second link</p> 
</section>
    
<section id="03" style="display: none">
    <p>This is the conent of the third link</p> 
</section>
&#13;
&#13;
&#13;

有人能指出我正确的方向来获得类似的东西:https://www.apotekhjartat.se/ ......

谢谢!

1 个答案:

答案 0 :(得分:0)

您正在寻找的内容称为Sticky Header

有各种librariestutorialsSO Questions可以帮助您。