Coder Social home page Coder Social logo

Comments (5)

jizai1125 avatar jizai1125 commented on July 16, 2024 1

Let me check, is it because the requestAnimationFrame API isn't supported?

from vue-countup-v3.

yojigoji avatar yojigoji commented on July 16, 2024

Let me check, is it because the requestAnimationFrame API isn't supported ?

If you find the answer, please let me know, thank you

from vue-countup-v3.

jizai1125 avatar jizai1125 commented on July 16, 2024

Let me check, is it because the requestAnimationFrame API isn't supported?

If you find the answer, please let me know, thank you

Which browser and version are you using?

from vue-countup-v3.

yojigoji avatar yojigoji commented on July 16, 2024

Let me check, is it because the requestAnimationFrame API isn't supported ?

If you find the answer, please let me know, thank you

Which browser and version are you using?

It is an embedded brwoser of Native App on Android 9 and Android 8. I guess it would be happened on system Browser also.

from vue-countup-v3.

jizai1125 avatar jizai1125 commented on July 16, 2024

Can you help me troubleshoot the problem? I don't have an Android 9 phone. To determine if the requestAnimationFrame API is the cause of the issue, you can try importing the polyfill below.

// make sure requestAnimationFrame and cancelAnimationFrame are defined
// polyfill for browsers without native support
// by Opera engineer Erik Möller
(function () {
  var lastTime = 0;
  var vendors = ['webkit', 'moz', 'ms', 'o'];
  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
      window[vendors[x] + 'CancelRequestAnimationFrame'];
  }
  if (!window.requestAnimationFrame) {
    window.requestAnimationFrame = function (callback) {
      var currTime = new Date().getTime();
      var timeToCall = Math.max(0, 16 - (currTime - lastTime));
      var id = window.setTimeout(function () { return callback(currTime + timeToCall); }, timeToCall);
      lastTime = currTime + timeToCall;
      return id;
    };
  }
  if (!window.cancelAnimationFrame) {
    window.cancelAnimationFrame = function (id) {
      clearTimeout(id);
    };
  }
})();

from vue-countup-v3.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.