Skip to content
Permalink
Browse files

Update hash in IE without flickering (Blitzdingsen)

This fix also solve not working customOffset in IE11.
  • Loading branch information...
TN03 committed May 16, 2019
1 parent 0b40b60 commit 5d593c3a31640a08bac24b8868a8eb9ab4c33106
Showing with 8 additions and 16 deletions.
  1. +8 −16 examples/onepage.js
@@ -88,16 +88,13 @@ jQuery(function ($) {
window.location.href = refreshUrl + hash;
}


//Hash "anspringen", damit Browser-Historie passt,
//aber nicht im IE11
if (!navigator.userAgent.match(/Trident.*rv\:11\./)
&& updateHash) {
//Aktuelle Position abspeichern
//var pos wird auch bei konstatnter Geschwindigkeit verwendet
var pos = $(window).scrollTop();
window.location.hash = hash;
$(window).scrollTop(pos);
//Hash aktualisieren, damit Browser-Historie passt,
if (updateHash) {
if(history.pushState) {
history.pushState(null, null, hash);
} else {
window.location.hash = hash;
}
}

var dest;
@@ -123,12 +120,7 @@ jQuery(function ($) {
*/

$("html,body").stop().animate({scrollTop: dest},
+ONEPAGE.scrollDuration, "swing", function () {
//im IE 11 Hash "anspringen"
if (updateHash && navigator.userAgent.match(/Trident.*rv\:11\./)) {
window.location.hash = hash;
}
});
+ONEPAGE.scrollDuration, "swing");
}

function toggleTopLink() {

0 comments on commit 5d593c3

Please sign in to comment.
You can’t perform that action at this time.