gpt4 book ai didi

javascript - 当我向下滚动到它们的 div 时如何使侧面 ID 导航链接处于事件/悬停状态

转载 作者:行者123 更新时间:2023-11-28 03:27:52 24 4
gpt4 key购买 nike

我正在研究一组固定在我页面侧面的跳转链接,它们链接到整个页面的主要 ID。我想知道如何让跳转链接在用户向下滚动到该 ID 或使用跳转链接转到该 ID 时显示为事件或悬停状态。我假设我需要为此使用 Jquery 但不完全确定。

我的网站是http://stormable.com/heroes/naziba/ .我想要的效果类似于边缘的跳转链接http://www.theverge.com/2013/11/15/5106888/sony-playstation-4-review

我使用的 HTML 是

<div id="jump-list-wrap">
<div id="jump-list">
<ul>
<li><a href="#stats">Stats</a></li>
<li><a href="#abilities">Abilities</a></li>
<li><a href="#talents">Talents</a></li>
<li><a href="#guides">Guides</a></li>
<li><a href="#skins">Skins</a></li>
</ul>
</div>
</div>

CSS 是

#jump-list-wrap{
position: absolute;
right: 65px;
top: 50px;
}

#jump-list{
position: absolute;
top: 0;
background-color: #353535;
border: solid 1px #151515;
display: block;
}

#jump-list.fixed {
position: fixed;
top: 100px;
}

#jump-list li a{
display: block;
border-bottom: solid 1px #121212;
padding: 5px 20px;
color: #f2f2f2;
text-decoration: none;
}

#jump-list li a:hover{
background-color: #3380c8;
}

谢谢

最佳答案

看起来像 JQuery .scroll() 方法。 http://api.jquery.com/scroll/

关于javascript - 当我向下滚动到它们的 div 时如何使侧面 ID 导航链接处于事件/悬停状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20034555/

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