Jump to content
Search Community

Syed Azam

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Syed Azam

  1. 11 minutes ago, Cassie said:

    If you look in the console you have an error - I suggest putting in some console logs to figure out which element you're trying to grab that doesn't exist.

     

    Cannot read properties of null (reading 'querySelectorAll')

    Thanks - do you have a demo or something for GSAP slider in gsap website - it would be of great help !! 

  2. I have added the dots functionality within for each code, and also is there a way the slider can autoplay, can you pl. have a look once ?

     

     

     

    /* for dots functionality s */
                let dur = 1
                let dots = document.querySelector(".dots")
     
                // set slides background colors and create the nav dots
                for (let i = 0i < index.lengthi++) {
                    gsap.set(index[i], {})
                    let newDot = document.createElement("div")
                    newDot.className = "dot"
                    newDot.index = i
                    navDots.push(newDot)
                    newDot.addEventListener("click"slideAnim)
                    dots.appendChild(newDot)
                }
     
                let allTheDots = dots.querySelectorAll(".dot")
     
                gsap.set(dots, { xPercent: -25 })
     
                const dotAnim = gsap.timeline({ paused: true })
                dotAnim.to(
                    allTheDots,
                    {
                        stagger: { each: 1yoyo: truerepeat: 1 },
                        scale: 1,
                        duration: 1,
                        rotation: 0.1,
                        backgroundColor: "#39FF14",
                    },
                )
                dotAnim.to
                    index.length + 1,
                    { y: -(index.length * 50), rotation: 0.01ease: "none" },
                    0
                )
                dotAnim.time(1)
     
                /* dot animation ends ********************************* */
  3. 57 minutes ago, nico fonseca said:

    Hey @Syed Azam, welcome to the forum! 💚

    You can do something like this: 

     


    The trick to achieve the mask effect is move the parent element to a direction and they child element to the opposite at the same time.

     

     

    gsap.to(parentElement, {
      xPercent: -100,
      duration:1
    });
    
    gsap.to(childElement, {
      xPercent: 100,
      duration:1,
    });


    I hope this can help you. 🙂
     


    Thanks nico fonseca :-) yes it really helped, can we also add additional functionalities on change of image to add a marque backside of image and circle with index like timer... 

     

    https://watch.screencastify.com/v/u8AFx5bucxgeuV7X9mKB 

    Appreciate your help..🙂

     

      

     

     

  4. Hi Guys, 

    I am very excited to work on GSAP n love this community for the quick response :-)

    As I am very new to this, I need some helping hands for my current slider component which I am working on...

     

    expecting - https://watch.screencastify.com/v/u8AFx5bucxgeuV7X9mKB 

     

    I am expecting a masking effect rather then sliding of images.. and on the current slide a marque to run behind.

     

     

     

     

    See the Pen OJgaRBd by syedazam (@syedazam) on CodePen

×
×
  • Create New...