无效 属性 ScrollTrigger Gsap Laravel
Invalid property ScrollTrigger Gsap Laravel
我在 laravel 安装 Gsap 后遇到警告:“无效 属性 ScrollTrigger 设置为 {trigger:“js-title-animation2”,开始:“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
您的 gsap 和 ScrollTrigger 版本可能不兼容
// 这对我有用
我在 laravel 安装 Gsap 后遇到警告:“无效 属性 ScrollTrigger 设置为 {trigger:“js-title-animation2”,开始:“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
您的 gsap 和 ScrollTrigger 版本可能不兼容
// 这对我有用