首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >跳转到页面特定部分时如何隐藏锚图标

跳转到页面特定部分时如何隐藏锚图标
EN

Stack Overflow用户
提问于 2021-12-10 08:51:12
回答 1查看 101关注 0票数 0

我有箭头向下点击跳转到特定的部分页面,点击滚动功能是有效的,但我需要当点击图标,然后跳到一个特定的箭头向下图标将隐藏。

代码语言:javascript
复制
.scroll-regform, .mobile {
    display: block!important;
}
.scroll-regform {
    position: fixed;
    right: 44%;
    top: 200px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    z-index: 3;
    line-height: 30px;
    text-align: center;
    color: #fff;
    font-size: 28px;

}
代码语言:javascript
复制
 <a href="#scroll-regform" href="#" class="scroll-regform"><i class="fa fa-angle-down animated-menu bounce" aria-hidden="true" alt="download" class="pt-8"></i></a>
 
 <div class="col-md-7" id="scroll-regform">
 <p>content</p>
 </div>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-10 09:16:18

代码语言:javascript
复制
$( ".scroll-regform" ).click(function() {
  $(this).addClass('hideIcon')
});
代码语言:javascript
复制
.scroll-regform, .mobile {
    display: block!important;
}
.scroll-regform {
    right: 44%;
    top: 200px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    z-index: 3;
    line-height: 30px;
    text-align: center;
    font-size: 28px;

}
.scroll-regform.hideIcon{
  display: none !important;
}
代码语言:javascript
复制
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a href="#scroll-regform" href="#" class="scroll-regform"><i class="fa fa-angle-down animated-menu bounce" aria-hidden="true" alt="download" class="pt-8">ICON</i></a>
 
 <div class="col-md-7" id="scroll-regform">
 <p>content</p>
 </div>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70301887

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档