逆风天 发表于 2021-12-4 20:04:00

修正wow.js结合Animate.css使用时 config is not defined 报错


修正 wow.js 结合 Animate.css 使用时 config is not defined 报错

解决步骤一:
wow.js 搜索

this.util().addEvent(box, 'animationend', this.resetAnimation);
this.util().addEvent(box, 'oanimationend', this.resetAnimation);
this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation);
this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation);修改为:
this.util().addEvent(box, 'animationend', this.resetAnimation.bind(this));
this.util().addEvent(box, 'oanimationend', this.resetAnimation.bind(this));
this.util().addEvent(box, 'webkitAnimationEnd', this.resetAnimation.bind(this));
      this.util().addEvent(box, 'MSAnimationEnd', this.resetAnimation.bind(this));即,增加绑定.bind(this)。
解决步骤二:
wow.js 搜索
return target.className = target.className.replace(config.animateClass, '').trim();修改为:
return target.className = target.className.replace(this.config.animateClass, '').trim();
搞定!

修改方法参考了一位博主的解决办法,原文地址。
页: [1]
查看完整版本: 修正wow.js结合Animate.css使用时 config is not defined 报错