jQuery中出现x.easing[this.easing] is not a function的解决办法

x.easing[this.easing] is not a function
Q: 使用jQuery的fadeIn和fadeOut出现以下报错,是由于jQuery版本过高导致,有以下两种解决方案。

1、降低jQuery版本至1.9.0以前的版本,下面是jQuery的CDN下载地址和Script脚本行

1) CDN链接:https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js

2) Script脚本:

2.使用animate方法实现

.toast{opacity:0}
function toast(text = '') {
   $('.toast').text(text).animate({opacity: 1}, 500)
   $('.toast').delay(1000).animate({opacity: 0}, 1000)
}

你可能感兴趣的:(jQuery中出现x.easing[this.easing] is not a function的解决办法)