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?

有帮助吗?

解决方案

Try using it inside

$(document).ready(function(){

/*Your code here*/

});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top