Hey there,
In a future release, it would be nice to have all internal links have a class, like InternalLink or something. Because when working with fixed headers, internal links need to the 'jump' from the top to be offset by a -[height of the fixed header]. And this makes it very difficult to do as of now (at least to my knowledge). I cannot figure out a quick way.
If each internal link (including quoting a reply, jumping to a post or a quote, jumping to a category, etc) had a class, a function can be written in jQuery or something that will say something like:
Not positive if this will work in all cases, but I don't know how else to get this done and people are wanting fixed navigations.
Thanks,
Mike
In a future release, it would be nice to have all internal links have a class, like InternalLink or something. Because when working with fixed headers, internal links need to the 'jump' from the top to be offset by a -[height of the fixed header]. And this makes it very difficult to do as of now (at least to my knowledge). I cannot figure out a quick way.
If each internal link (including quoting a reply, jumping to a post or a quote, jumping to a category, etc) had a class, a function can be written in jQuery or something that will say something like:
Code:
function offsetInternalJump(target, offset) {
$target = $(target);
if ($target) {
$('html, body').scrollTop($target.offset().top - offset,
function () {
window.location.hash = target;
});
}
}
$(document).ready(function() {
$('.InternalLink').on('click', function() {
offsetInternalJump(this.hash, '110'); //where 110 is a style property of fixed nav height
});
});
Not positive if this will work in all cases, but I don't know how else to get this done and people are wanting fixed navigations.
Thanks,
Mike
Upvote
3