Smooth Scrolling issue

Duplicate Issue #7506724 • See Issue #7506700

Details

Author
Nicolas D.
Created
May 10, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
  • Internet Explorer
Duplicates
See progress on Bug #7506700
Found in build #
13.10586
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Hi,

I’m using a code to get a smooth scrolling with Javascript and in IE and Edge it doesn’t work like expected.

I use this code :

$(document).ready(function(){
$('a[href^="#"]').on('click’,function (e) {
e.preventDefault();

    var target = this.hash;
    var $target = $(target);
    var i = $(this).attr("href");
    var k = $(i).offset().top;
    $('html, body').stop().animate({
        scrollTop: k - 150
    }, 1800, 'swing' ,function () {
        window.location.hash = target;
    });
});
});

If I remove the last function with window.location.hash, it work and stop 150px on top of section id (k-150), but if I have this function added, it stop at 150px on top and right after it go to section like if you don’t have smooth scrolling. It’s like that when it add the # in the URL it go to anchor link without just adding it in URL.

Try in Chrome vs Edge or IE.

My website (currently WIP)
http://newsite.nicolas-duclos.com

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Status to “Duplicate”

    • Hello,

      This item appears to be a duplicate of an existing item of feedback and will be closed out to reflect this. Please follow the existing item here for updates on this issue:

      https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7506700/

      All the best,
      The MS Edge Team

    You need to sign in to your Microsoft account to add a comment.

    Sign in