How to position the section below the menu

0

I'm using the Anchor menu, and when I click the link it gets to the top of the menu, how do I position it under the menu?

How it works:

Howtostay:

code:'Script'

<script>varmenu=$('#menu.navli');varsectionPositions=$('section').map(function(){return$(this).position().top;});varsections=$('section');$(document).on('scroll',function(){varscroll=$(document).scrollTop();varcurrentElement;$(sectionPositions).each(function(i){if(scroll>this-50)currentElement=menu[i];});currentElement&&addClass(currentElement);});menu.on('click',function(){addClass(this);});functionaddClass(el){menu.removeClass('active');$(el).addClass('active');};</script>

Section

<sectiondata-slide="4" id="Devices">
        <div class="row">
            <div class="div2 text-center">
                <img class="div2Img" src="~/Content/Images/BackGround/dispositivos.png" />

                <p class="div2Texto">Seu Site ou Software funcionando em qualquer dispositivo</p>
            </div>
        </div>
    </section>

Menu

<li><a href="#Devices">Dispositivos</a></li>
    
asked by anonymous 29.12.2016 / 00:22

1 answer

0

From what I've seen you're using menu with position:fixed , to solve just add a padding-top to body :

body 
{ 
    padding-top: 60px; // altura do seu menu
}
    
01.01.2017 / 15:26