jQuery(function($){ if(cur_page_data.pageid == 1){ $('.header').css('width','90%'); } }); function prepareMenuForDesktop() { var navbarHeight = 0; // For screens greater than 767 if($(window).width() > 767) { // target at which the menu bar changes to sticky var target = $(".blog_row").offset().top - 100; // window scroll $(window).scroll(function(){ if($(this).scrollTop() > target) { $(".menubar").addClass("sticky"); } else { $(".menubar").removeClass("sticky"); } }); navbarHeight = 56; } } $(document).ready(function(){ prepareMenuForDesktop(); // On window resize, prepare menu $(window).resize(function(){ prepareMenuForDesktop(); }); });