I'm trying to fix an issue on the mobile navigation of this page: http://tinyurl.com/kq9xs6h
The tags are dynamically created in a JS function:
mobile_advanced = menu.clone().attr({id:"mobile-advanced", "class":""}),
Which results in generating this HTML line:
<ul class="" id="mobile-advanced" style="position: absolute;">
The following code is working when using the browser console (so when the html has been generated):
jQuery('#mobile-advanced a').on('click', function() {
jQuery('body').removeClass('show_mobile_menu');
jQuery('body').removeClass('show_mobile_meta');
jQuery('body').css({'height':'auto'});
});
But when I insert it in my JS file, the event's handler is not understood.
Where should I put this piece of code or how do I need to modify it so the handler is taken into account?