I am trying to make a responsive nav. I am using some jquery but I don't know javascript very well. I would like the toggle to take place when the window is a certain width (e.g. 1050px) this is the script
function adaptMenu() {
    /*  toggle menu on resize */
    $('nav').each(function() {
        var $width = $(this).css('max-width');
        $width = $width.replace('px', '');
        if ($(this).parent().width() < $width * 1.05) {
            $(this).children('.nav-main-list').hide(0);
            $(this).children('.nav-toggled').show(0);
        } else {
            $(this).children('.nav-main-list').show(0);
            $(this).children('.nav-toggled').hide(0);
        }
    });
}