Hi,
the anchor - What we do = #gkHeader lead little lower that its should be. How can I fix that? Where can I find the anchor position?
Thanks,
Gorast
// SmoothScroll jQUery substitue
jQuery('a[href^="#"]').click( function (e) {
e.preventDefault();
var target = this.hash,
$target = jQuery(target);
if($target.length) {
jQuery('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 1000, 'swing', function () {
window.location.hash = target;
});
} else {
window.location.hash = target;
}
});
'scrollTop': ($target.offset().top - 50)
Cyberek wrote:If you will reduce padding of all elements with the same ammount, you might look int this js:
templates/gk_creativity/js/gk.scripts.js
into section:
- Code: Select all
// SmoothScroll jQUery substitue
jQuery('a[href^="#"]').click( function (e) {
e.preventDefault();
var target = this.hash,
$target = jQuery(target);
if($target.length) {
jQuery('html, body').stop().animate({
'scrollTop': $target.offset().top
}, 1000, 'swing', function () {
window.location.hash = target;
});
} else {
window.location.hash = target;
}
});
You can offset the point to where the browser scrolls to:
- Code: Select all
'scrollTop': ($target.offset().top - 50)
window.location.hash = target;