mirror of
https://github.com/thewesker/startbootstrap-clean-blog.git
synced 2025-12-20 12:11:07 -05:00
Merge pull request #17 from Tarabass/gh-pages
IE - Fixed scrolling issue with navbar when scrolling up.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
*.idea
|
||||||
@@ -1003,30 +1003,30 @@ $(function() {
|
|||||||
|
|
||||||
// Navigation Scripts to Show Header on Scroll-Up
|
// Navigation Scripts to Show Header on Scroll-Up
|
||||||
jQuery(document).ready(function($) {
|
jQuery(document).ready(function($) {
|
||||||
var MQL = 1170;
|
var MQL = 1170;
|
||||||
|
|
||||||
//primary navigation slide-in effect
|
//primary navigation slide-in effect
|
||||||
if ($(window).width() > MQL) {
|
if ($(window).width() > MQL) {
|
||||||
var headerHeight = $('.navbar-custom').height();
|
var headerHeight = $('.navbar-custom').height();
|
||||||
$(window).on('scroll', {
|
$(window).on('scroll', {
|
||||||
previousTop: 0
|
previousTop: 0
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
var currentTop = $(window).scrollTop();
|
var currentTop = $(window).scrollTop();
|
||||||
//check if user is scrolling up
|
//check if user is scrolling up
|
||||||
if (currentTop < this.previousTop) {
|
if (currentTop < this.previousTop) {
|
||||||
//if scrolling up...
|
//if scrolling up...
|
||||||
if (currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) {
|
if (currentTop > 0 && $('.navbar-custom').hasClass('is-fixed')) {
|
||||||
$('.navbar-custom').addClass('is-visible');
|
$('.navbar-custom').addClass('is-visible');
|
||||||
} else {
|
} else {
|
||||||
$('.navbar-custom').removeClass('is-visible is-fixed');
|
$('.navbar-custom').removeClass('is-visible is-fixed');
|
||||||
}
|
}
|
||||||
} else {
|
} else if (currentTop > this.previousTop) {
|
||||||
//if scrolling down...
|
//if scrolling down...
|
||||||
$('.navbar-custom').removeClass('is-visible');
|
$('.navbar-custom').removeClass('is-visible');
|
||||||
if (currentTop > headerHeight && !$('.navbar-custom').hasClass('is-fixed')) $('.navbar-custom').addClass('is-fixed');
|
if (currentTop > headerHeight && !$('.navbar-custom').hasClass('is-fixed')) $('.navbar-custom').addClass('is-fixed');
|
||||||
}
|
}
|
||||||
this.previousTop = currentTop;
|
this.previousTop = currentTop;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
2
js/clean-blog.min.js
vendored
2
js/clean-blog.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user