funkcja resize outer height

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
<body>
    <script>
        if ($("#nav").outerHeight() > $( window ).height()) {
            $('#nav').addClass('test-over');
        }else{
            $('#nav').removeClass('test-over');
        }
        $(window).resize(function() {
            if ($("#nav").outerHeight() > $( window ).height()) {
                $('#nav').addClass('test-over');
            }else{
                $('#nav').removeClass('test-over');
            }
        });
    </script>
</body>
</html>
Komentarze wyłączone