MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus DG HochN-Wiki
(kein Unterschied)
|
Aktuelle Version vom 27. Juni 2024, 11:11 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */
/* Offset für fixed Navigation bei Ankerlinks */
(function($, window) {
var adjustAnchor = function() {
var $anchor = $(':target'),
fixedElementHeight = 100;
if ($anchor.length > 0) {
/* With animation */
// $('html, body')
// .stop()
// .animate({
// scrollTop: $anchor.offset().top - fixedElementHeight
// }, 200);
/* Without animation */
window.scrollTo(0, $anchor.offset().top - fixedElementHeight);
}
};
$(window).on('hashchange load', function() {
adjustAnchor();
});
})(jQuery, window);