1
I have an anchor link that takes a button at the top to a certain part of the page, but as my menu accompanies the page, it ends up being cut as in the image below:
How would I give a space? Margin or position, I don’t know, but I need the link to go down so it looks like this:
I’m using a script to smooth the scrolling:
<script type="text/javascript">
jQuery(document).ready(function($) {
$(".scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 800);
});
});
</script>
Put a + 20 after the .top.
scrollTop:$(this.hash).offset().top + 20
– Diego Souza
show @Zoom, it worked perfectly, I only put negative value, because the positive went up even more, but the solution was perfect! Thanks!
– Raylan Soares
So it was negative. Always confusing... Rsrsrs
– Diego Souza
Hello. @Zoom enter answer to get answered :)
– Tiago Gomes