Jump to content
Search Community

PixelatedOrange

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by PixelatedOrange

  1. Hi all.

     

    I've got an odd one that I thought I had working but it's stopped.

     

    https://staging.dezarnaulds-design.com

     

    The concept is that as you scroll down the background image on the right scales by 20% from 100% to 120%.

     

    I've set the background size in css on the .home-header-right to 100%, then on the gsap I have this...

     

    backgroundSize: '120%'

     

    It did work - the image was @ 100% then got larger as you scrolled down, but for some bizarre reason, it now resets to auto as start hits the trigger.

     

    Is it possible in the below code to set the before scroll styles?

     

    gsap.to(".home-header-right", {
      scrollTrigger: {
    	  trigger: ".home-header-left",
    	  start: "top top",
    	  end: "bottom bottom",
    	  scrub: true,  
      },
      duration: 3,
      backgroundSize: '120%',
    });

    Thanks for any help!!

  2. Hi all.

     

    Newbie here so apologies for the basic question.

     

    I'd like to add margin-top to an element I'm animating, but when I use margin-top: '50px' it doesn't work - my error console shows...

    Unexpected token '-'. Expected a ':' following the property name 'margin'.

     

    What's the correct way to do this please?

     

    Thanks in advance.

  3. No, just me being new to this and getting my head around the coding :-)

     

    Am still very green to scrollTrigger, so appreciate your pointers about scrub and toggleActions, was following the main tutorial and didn't see that bit removed when scrub was enabled, but learnt a lot today already!

     

    Thanks both, getting the hang of it now :-)

     

     

    • Like 1
  4. Hi all.

    Seriously newbie question here, but hope someone can help.

     

    I've got a simple scrubbed scrollTrigger that expands a div when it scrolls into the viewport.

     

    There's multiple divs of the same class as you go down the page - is there any way to use the same code for all divs?

     

    gsap.to(".underlined .border", {
          scrollTrigger: {
              trigger: ".underlined .border",
              end: "bottom center",
              toggleActions: "restart pause restart pause",
              scrub: true,
          },
          duration: 2,
          left: '0',
          right: '0'
        });

     

    Above is the scrollTrigger, and I'd like ALL divs with the class .border to do the same thing, but relative to when they each enter the screen.

     

    Thanks in advance.

×
×
  • Create New...