Question

I'm using de layout framework called Clip-one

I put the html code of menu in a separate file, and i'm loading the menu on the end of index page.

The menu is loaded successfully, but the actions of this menu, like a click, doesn't work.

Every page needs to call an function called Main.init(). But seems like this function isn't called, because when i call her on chrome's console, the menu working.

This is my code at end of page:

<script>
        //Verifica o login do cara 
        var log = new cLogin();
        log.verificaLogin();

        //Faz o init 
        initIndexComponents();
        Main.init();
</script>

The function initIndexComponents() load the menu in the box-menu div

Just when a call again de Main.init() in console, the menu work.

Someone know whats going on?

Was it helpful?

Solution

Try using it inside

$(document).ready(function(){

/*Your code here*/

});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top