安装Gsap后,我在laravel中遇到警告:“ScrollTrigger属性设置为{trigger:"js-title-animation2",start:"20px 80%",markers: true,toggleActions:"resart pause reverse none"}缺少插件? gsap.registerPlugin()”
file.blade.php
@section('scripts')
<script type="text/javascript" src="{{asset('js/newHome.js') }}"></script>
<script src=" {{asset('/js/scripts/gsap.min.js') }} "></script>
<script src="{{asset('/js/scripts/ScrollTrigger.min.js')}}"></script>
<script>
// TweenMax.to('.js-title-animation', 1, {rotation: 360});
// gsap.registerPlugin(ScrollTrigger);
gsap.to('.js-title-animation', {duration: 3, text: '@lang('home.header-title-new-home')', ease: "none"});
// gsap.to('.js-title-animation2', {duration: 3, text: '@lang('home.header-subtitle-new-home')', ease: "none"});
gsap.to('.js-title-animation2', {ScrollTrigger: {
trigger: 'js-title-animation2',
start: "20px 80%",
markers: true,
toggleActions: "resart pause reverse none"
},
x: 200,
rotation: 360,
duration: 3
});
</script>
@endection发布于 2021-03-17 13:24:55
您可能有不兼容的gsap和ScrollTrigger版本
//适用于我
< script src = "">https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.0/gsap.js">
< script src = "">https://cdnjs.cloudflare.com/ajax/libs/gsap/3.6.0/ScrollTrigger.js">
//源https://greensock.com/docs/v3/Installation?checked=core,scrollTrigger,debug#CDN
对不起,我的英语很差
https://stackoverflow.com/questions/66228200
复制相似问题