jquery 获取css3动画animation的值,改变animation的值问题

html-css06

jquery 获取css3动画animation的值,改变animation的值问题,第1张

把上面的

$(this).css("animation","running")

改成

$(this).css("animation-play-state","running")

试一下

你确定你测试的浏览器兼容animation样式吗?

还有你有微animation写@keyframes吗?

这个css是实现不了的,你可以通过js或者jq来判断,屏幕滚动到某一点上的时候,给对应的元素加上动画类。

或者你还可以选着用现成的jQ插件来实现,页面滚到某一位置时,就会出现相应的动画,推荐你去百度搜一下 wow.js或则 aos.js

var getKeyFramse = function(index){ var styleSheet = document.styleSheets[index], keyframesRule = [][].slice.call(styleSheet.cssRules).forEach(function(item){ if (item.type === CSSRule.WEBKIT_KEYFRAMES_RULE) { keyframesRule.p...