Skip to content

Instantly share code, notes, and snippets.

@thanhtungdp
Created April 13, 2016 09:14
Show Gist options
  • Select an option

  • Save thanhtungdp/083ac7afb64ef6b9d6794f3c5edf6a77 to your computer and use it in GitHub Desktop.

Select an option

Save thanhtungdp/083ac7afb64ef6b9d6794f3c5edf6a77 to your computer and use it in GitHub Desktop.
/*!
* Start Bootstrap - Grayscale Bootstrap Theme (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
// jQuery to collapse the navbar on scroll
function collapseNavbar() {
if ($(".navbar").offset().top > 50) {
$(".navbar-fixed-top").addClass("top-nav-collapse");
} else {
$(".navbar-fixed-top").removeClass("top-nav-collapse");
}
}
$(window).scroll(collapseNavbar);
$(document).ready(collapseNavbar);
// jQuery for page scrolling feature - requires jQuery Easing plugin
$(function () {
$('a.page-scroll').bind('click', function (event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function () {
if ($(this).attr('class') != 'dropdown-toggle active' && $(this).attr('class') != 'dropdown-toggle') {
$('.navbar-toggle:visible').click();
}
});
var logoUnderline = false;
setInterval(function () {
if (logoUnderline) {
$(".navbar-brand .underline").addClass('hide');
logoUnderline = false;
} else {
$(".navbar-brand .underline").removeClass('hide');
logoUnderline = true;
}
}, 800);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment