S
S
Socrates2018-03-14 13:43:53
css
Socrates, 2018-03-14 13:43:53

Animate not working in Microsoft Edge?

Made a smooth scroll to the anchor on jquery:

$('a[href^="#"]').click(function () {
     elementClick = $(this).attr("href");
     destination = $(elementClick).offset().top-120;
     if($.browser.safari){
       $('body').animate( { scrollTop: destination }, 500 );
     }else{
       $('html').animate( { scrollTop: destination }, 500 );
     }
     return false;
   });

Doesn't work in Microsoft Edge, does anyone know why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2018-03-14
@Karmov69

it works for me like this

$('.js-scroll-to').click(function (e) {
            e.preventDefault();
            $('html, body').stop().animate({
                scrollTop: $($(this).attr('href')).offset().top
            }, 500);
        });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question