Initial commit
This commit is contained in:
commit
ce75b6d2a3
26 changed files with 14735 additions and 0 deletions
45
js/bootswatch.js
Normal file
45
js/bootswatch.js
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
$('a[rel=tooltip]').tooltip({
|
||||
'placement': 'bottom'
|
||||
});
|
||||
|
||||
|
||||
$('.navbar a, .subnav a').smoothScroll();
|
||||
|
||||
|
||||
(function ($) {
|
||||
|
||||
$(function(){
|
||||
$('.logo_klein').toggle();
|
||||
// fix sub nav on scroll
|
||||
var $win = $(window),
|
||||
$body = $('body'),
|
||||
$nav = $('.subnav'),
|
||||
navHeight = $('.navbar').first().height(),
|
||||
subnavHeight = $('.subnav').first().height(),
|
||||
subnavTop = $('.subnav').length && $('.subnav').offset().top - navHeight,
|
||||
marginTop = parseInt($body.css('margin-top'), 10);
|
||||
isFixed = 0;
|
||||
|
||||
processScroll();
|
||||
|
||||
$win.on('scroll', processScroll);
|
||||
|
||||
function processScroll() {
|
||||
var i, scrollTop = $win.scrollTop();
|
||||
|
||||
if (scrollTop >= subnavTop && !isFixed) {
|
||||
isFixed = 1;
|
||||
$nav.addClass('subnav-fixed');
|
||||
$('.logo_klein').toggle();
|
||||
$body.css('margin-top', marginTop + subnavHeight + 'px');
|
||||
} else if (scrollTop <= subnavTop && isFixed) {
|
||||
isFixed = 0;
|
||||
$nav.removeClass('subnav-fixed');
|
||||
$('.logo_klein').toggle();
|
||||
$body.css('margin-top', marginTop + 'px');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})(window.jQuery);
|
||||
Loading…
Add table
Add a link
Reference in a new issue