Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixing window width issue
  • Loading branch information
Roy committed Jan 18, 2017
1 parent b204c20 commit e8bfeef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/stickynav.js
Expand Up @@ -11,7 +11,7 @@ jQuery(document).ready(function( $ ) {
if($('#wpadminbar').length > 0) adminHeight = $('#wpadminbar').outerHeight();
elem.attr('data-top', Math.round(parseFloat(offset.top - adminHeight)));
}
if ($(window).width() >= 768 && Math.round(parseFloat(elem.attr('data-top'))) - elem.outerHeight() <= $(this).scrollTop() - $(elem).outerHeight()){
if (window.innerWidth >= 768 && Math.round(parseFloat(elem.attr('data-top'))) - elem.outerHeight() <= $(this).scrollTop() - $(elem).outerHeight()){
elem.addClass('navbar-fixed-top');
elem.css('padding-top',$('#wpadminbar').outerHeight());
}
Expand All @@ -27,7 +27,7 @@ jQuery(document).ready(function( $ ) {
$('#masthead').children().each(function(){mastheadHeight += $(this).height();});
$('#masthead').css('height',mastheadHeight+'px');
var elem = $('#nav-wrapper');
if ($(window).width() >= 768 && !elem.hasClass('navbar-fixed-top')){
if (window.innerWidth >= 768 && !elem.hasClass('navbar-fixed-top')){
var offset = elem.offset();
var adminHeight = 0;
if($('#wpadminbar').length > 0) adminHeight = $('#wpadminbar').outerHeight();
Expand Down

0 comments on commit e8bfeef

Please sign in to comment.