Dymanic 'active' class using nav tag looping through a structure
My recommendation is to match the slugs as opposed to the ids as this is much easier to debug.

&lt;ul id="slide-in"&gt; 
    {% nav menu in craft.entries.section('mainMenu') %}
        DEBUG: Entry.slug={{ entry.slug }} 
        DEBUG: menu.slug={{ menu.slug }} 
        &lt;li class="{{ menu.slug == entry.slug ? 'active' }}"&gt;
            &lt;a href="{{ menu.menuLink[0].url }}"&gt;{{ menu.title }}&lt;/a&gt;
        &lt;/li&gt;
    {% endnav %}
&lt;/ul&gt;


Then obviously remove the debug lines once everything is working as intended :)