I have arrow down click to jump to a specific part of page, click to scroll fuction is working but I need when click on icon then jump to a specific arrow down icon will hide.
.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;
}
<a href="#scroll-regform" href="#" ><i aria-hidden="true" alt="download" ></i></a>
<div id="scroll-regform">
<p>content</p>
</div>
CodePudding user response:
$( ".scroll-regform" ).click(function() {
$(this).addClass('hideIcon')
});
.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;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a href="#scroll-regform" href="#" ><i aria-hidden="true" alt="download" >ICON</i></a>
<div id="scroll-regform">
<p>content</p>
</div>