作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在研究一组固定在我页面侧面的跳转链接,它们链接到整个页面的主要 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/
我是一名优秀的程序员,十分优秀!