Skip to content

Commit

Permalink
fix home/page issue when no #menu div exist in the dom
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhgorh committed Dec 26, 2016
1 parent 90eb482 commit fe96edd
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,20 @@ $(document).ready(function(){
$("#menu > #nav").hide();
}
});
}
} else {
$(window).on('scroll', function() {
var topDistance = $("#nav").offset().top;

$(window).on('scroll', function() {
var topDistance = $("#menu > #nav").offset().top;
if ( ! $( "#menu-icon" ).is(":visible") && topDistance < 50 ) {
$("#menu-icon-tablet").show();
$("#top-icon-tablet").hide();
} else if (! $( "#menu-icon" ).is(":visible") && topDistance > 100) {
$("#menu-icon-tablet").hide();
$("#top-icon-tablet").show();
}
});
}

if ( ! $( "#menu-icon" ).is(":visible") && topDistance < 50 ) {
$("#menu-icon-tablet").show();
$("#top-icon-tablet").hide();
} else if (! $( "#menu-icon" ).is(":visible") && topDistance > 100) {
$("#menu-icon-tablet").hide();
$("#top-icon-tablet").show();
}
});

if ( $( "#footer-post" ).length ) {
var lastScrollTop = 0;
Expand Down

0 comments on commit fe96edd

Please sign in to comment.