Team:Freiburg/Templates/html/js.html
From 2014.igem.org
(Difference between revisions)
Line 41: | Line 41: | ||
$('#content-nav').affix({ | $('#content-nav').affix({ | ||
- | + | offset: { | |
- | + | top: function () { | |
- | + | return (this.top = $('.content-wrapper').offset().top - 60) | |
+ | } | ||
+ | , bottom: function () { | ||
+ | return (this.bottom = $('.footer').outerHeight(true)) | ||
+ | } | ||
} | } | ||
- | + | }); | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | $('header nav').affix({ | |
- | + | offset: { | |
- | + | top: function () { | |
- | + | return (this.top = $('header .header-banner').outerHeight(true) + 5) | |
- | + | } | |
- | + | , bottom: function () { | |
- | + | return (this.bottom = $('.footer').outerHeight(true)) | |
+ | } | ||
} | } | ||
- | + | }); | |
- | + | ||
$('header nav').on('affixed.bs.affix', function(){ | $('header nav').on('affixed.bs.affix', function(){ | ||
//pad the content so the affixed navbar stays visible | //pad the content so the affixed navbar stays visible |
Revision as of 16:33, 16 September 2014