Hallo Forum,
folgender Code ist bei mir im Header
PHP
<script>
$(document).ready(function(){
$('a[href*="#"]:not([href="#"]):not([data-toggle])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target
|| $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset(150).top -105;
$('html,body')
.animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});
});
</script>
Alles anzeigen
Im Firefox funktioniert alles perfekt. Jedoch in Chrome, IE, Edge & Opera stimmt der Offset von den Anchor nicht. Ich habe keine Ahnung woran das liegen könnte...
Kann mir da jemand helfen? Danke.