MediaWiki:Common.js: Unterschied zwischen den Versionen
Aus DG HochN-Wiki
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 3: | Zeile 3: | ||
/* Offset für fixed Navigation bei Ankerlinks */ | /* Offset für fixed Navigation bei Ankerlinks */ | ||
(function($, window) { | (function($, window) { | ||
var adjustAnchor = function() { | |||
var $anchor = $(':target'), | |||
fixedElementHeight = 100; | |||
if ($anchor.length > 0) { | |||
window.scrollTo(0, $anchor.offset().top - fixedElementHeight); | |||
} | |||
}; | |||
$(window).on('hashchange load', function() { | |||
adjustAnchor(); | |||
}); | |||
})(jQuery, window); | |||
/* Dynamische URL für den "Zum Bearbeitungsfeld gehen"-Link */ | |||
(function($) { | |||
$(document).ready(function() { | |||
$('.mw-continue-editing a[href="#editform"]').each(function() { | |||
$(this).attr('href', window.location.href); | |||
}); | }); | ||
}); | |||
})(jQuery); | |||
Version vom 6. November 2025, 10:40 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) {
window.scrollTo(0, $anchor.offset().top - fixedElementHeight);
}
};
$(window).on('hashchange load', function() {
adjustAnchor();
});
})(jQuery, window);
/* Dynamische URL für den "Zum Bearbeitungsfeld gehen"-Link */
(function($) {
$(document).ready(function() {
$('.mw-continue-editing a[href="#editform"]').each(function() {
$(this).attr('href', window.location.href);
});
});
})(jQuery);