Git Product home page Git Product logo

Comments (2)

sl1673495 avatar sl1673495 commented on June 14, 2024

膜拜大佬...666技术好文。这里本菜鸡也来分享一波:
之前遇到requestAnimFrame 这个api会存在兼容性的问题,
一般涉及动画可以这样,做个回调,在浏览器不支持这个api接口的时候,可以这样:
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 16.7);
};
})();

另外,有个建议,动画模块在不考虑兼容的情况,千万不要因为想要贪图方便用jq的animate(),在某些特效上会卡帧(相信有朋友也像我一样被坑过),请优先考虑使用css3。这也是一个坑。
如果,如果,要做一些比较兼容的特效,可以去了解一下animate.css,很好用。

谢谢分享

from blogs.

Han3Jim avatar Han3Jim commented on June 14, 2024

不错

from blogs.

Related Issues (20)

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.