Commit be426755 authored by Phil Hughes's avatar Phil Hughes

Fixed scroll position on features

parent 6c333f49
Pipeline #2148916 passed with stage
......@@ -76,7 +76,7 @@ $(function() {
$qnav = $('#qnav');
if ($qnav.length) {
extraHeight += $qnav.outerHeight();
extraHeight += $qnav.outerHeight() - 2;
}
if ($el.length) {
......@@ -90,11 +90,17 @@ $(function() {
$(window).on('load', function () {
setTimeout(function() {
if (window.location.hash !== '') {
var target = $('a[name="' + window.location.hash.replace('#', '') + '"]'),
extraHeight = $('.navbar-header').outerHeight();
var hash = window.location.hash,
$el = $('a[name="' + hash.replace('#', '') + '"], ' + hash + ''),
extraHeight = $('.navbar-header').outerHeight(),
$qnav = $('#qnav');
if (target.length) {
$(window).scrollTop(target.offset().top - extraHeight);
if ($qnav.length) {
extraHeight += $qnav.outerHeight() - 2;
}
if ($el.length) {
$(window).scrollTop($el.offset().top - extraHeight);
}
}
}, 10);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment