Detecting Browser Window Size/ Resize

Detecting Browser Window Size/ Resize

Change the size of your browser window to see the script in action.

             jQuery(document).ready(function () {
                if (jQuery(window).width() < 900) {
                    jQuery(".top-menu").css("display", "none");
                }
                });
            jQuery(window).resize(function () {
                if (jQuery(window).width() < 900) {
                    jQuery(".top-menu").css("display", "none");
                }
                else {
                    jQuery(".top-menu").css("display", "block");
                }
                });