DINAMIC MENU WITH viewScroller.js

0

I want to make a menu that changes the name depending on the section in which it is located, it must be fixed all the time, the page is developed with viewScroller.js and until now I have not managed to get it:

link < - It's the same structure as this one

As for the menu I have it like this

                <div id="side">
                <div class="icMenu">
                    <div class="hamburger">
                        <div class="hamburger-inner"></div>
                    </div> 
                </div>
                <h3 class="tituloSection" id="tittle">Home</h3> 
            </div>
            <div id="sidePrev">
                <a><img src="imagenes/web-mano-santa-arrow-right.png" width="50%" class="indicadorNext vs-mainview-next"></a>
            </div>
            <div id="sideNex">
                <a><img src="imagenes/web-mano-santa-arrow-left.png" width="50%" class="indicadorNext vs-mainview-prev"></a>
            </div>
            <div id="sideFoot">
                <i class="fa fa-instagram fa-lg whiteIcons" ></i><br><br><br>
                <i class="fa fa-facebook fa-lg whiteIcons" ></i>
            </div>
            <div id="menuBarra">
            </div>

What you should change is what "home" says

    
asked by Erik Shasha 20.09.2018 в 15:29
source

1 answer

0

First, you should check the onScroll event

When doing the onScroll, you must check that each of the sections is visible

$(".mainview").forEach(function (obj, index){
   //Aqui chequea si es visible. 
   // Y si es visible actualizas el boton
});

Depending on what you consider to be visible to each section (I suppose that you will have to look good to behave as expected).

You can change the value with the following order:

$("#tittle")[0].innerHTML("LoQueTuQuieras");

Remember that in the foreach, you can access every obj that you locate, so you can know their name directly, and apply that name to tittle

    
answered by 20.09.2018 в 16:29