"Gsap both animation"
Bootstrap 4.1.1 Snippet by ranjit1602

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="main.css"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous"> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script> </head> <body> <section class="section1" style="padding-top:10%"> <div class="container mt-50 "> <div class="row gap-5 "> <div class="col-lg-4 h-100 bg-danger service-left"> 1 </div> <div class="col-lg-4 h-100 bg-dark service-right"> 2 </div> <div class="col-lg-4 h-100 bg-light service-left"> 3 </div> </div> </section> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.13.0/gsap.min.js" integrity="sha512-NcZdtrT77bJr4STcmsGAESr06BYGE8woZdSdEgqnpyqac7sugNO+Tr4bGwGF3MsnEkGKhU2KL2xh6Ec+BqsaHA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.13.0/ScrollTrigger.min.js" integrity="sha512-P2IDYZfqSwjcSjX0BKeNhwRUH8zRPGlgcWl5n6gBLzdi4Y5/0O4zaXrtO4K9TZK6Hn1BenYpKowuCavNandERg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script src="script.js"></script> </body> </html>
body{ padding: 0px; margin: 0px; box-shadow:0px; overflow-x: hidden; height: 3000px; } .service2{ color: #ffffff} .section1{ margin-top: 10%;}
//box animation var ranjit = gsap.timeline({ scrollTrigger:{ trigger:".section1", scroller:"body", start:"top 10%", end:"top 50%", scrub:2, } }) ranjit.from(".service-left",{ x:-300, opacity:0, duration:1 },"same-animation") ranjit.from(".service-right",{ x:300, opacity:0, duration:1 },"same-animation")

Related: See More


Questions / Comments: