F
F
FNY3PM2019-07-05 13:06:58
JavaScript
FNY3PM, 2019-07-05 13:06:58

Why doesn't this feature work on iPhones?

Why does this code work everywhere except for iOS devices? Doesn't work on iphone in safari or chrome. Help me please.

function scrollToElem(elem) {
    var st = $('body').scrollTop() || $('html').scrollTop();

    $('body, html').animate({
      scrollTop: ($(elem).offset().top + st) + "px"
    }, 2000);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pcdesign, 2019-07-05
@pcdesign

https://stackoverflow.com/questions/29978616/jquer...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question