Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Jamesh

ShockinglyGreen
  • Posts

    37
  • Joined

  • Last visited

About Jamesh

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. In the interest of helping out others, and from @GreenSock suggestions please find best solution below: https://codepen.io/jame5/pen/QWQowjp
  2. Thanks Jack. I agree its certainly a CSS issue, in part. Would be great to hear your further thoughts on the 'oddness' you mentioned. All the best. James
  3. Here's a little playground of the workaround I eluded to above...still not right though https://codepen.io/jame5/pen/ExQrepJ
  4. Ive been trying for a couple of days to get this to work! Essentially I have smoothscroller working with some simple parallax effects when scrolling through the page. The issue I'm having is that if the text on the opposite site of the image is longer that the image is creates a blank at the bottom of the image (you may need to resize your viewport). Please see last section of the codepen attached. I guess this makes sense as the CSS is specifically setting the height to 100vh but does anyone know of a solution whereby the image always fills its container to mirror the height of its sibling element? I thought a workaround would be to find the height of the text element and then set the image-cont-height to mirror the height and then use calc in js to add additional pixels to create the parallax effect.
  5. @akapowl. So this is how far I've got with my 'read more' text. I want to be able to get the read more text to expand as the screen is resized which I've achieved but when the button is used to close the text its not as smooth as I would like . I was hoping that I might have been able to use offsetHeight as part of a resize addEventListener but the height was being set as an inline style and I couldn't get it to refresh so I have opted to set height to auto as it currently stands. The problem I have is that the animation is 'jerky' if you resize the screen with the read more section active and then click the button to see 'less about us'. Is there any way of refreshing on resize to ensure that GSAP understands the exact height of the element to ensure a smooth animation? Codepen URL below: https://codepen.io/jame5/pen/NWyPmJb
  6. Thanks for this. I didnt know about transitionend. As I was already using GSAP I went down the GSAP tween route - much less code (12 lines versus 64 my other way!!). I also took advantage of onReverseComplete: () => ScrollTrigger.refresh(),. Thanks again.
  7. I have a a "click" event listener that expands some read more text. I have called ScrollTrigger.refresh(true) in that callback which is kind of working. I have a transition being applied to the height of the element of 500ms, so the refresh is slightly out when recalculating the trigger position. I read that if trueis set, it will wait for at least one requestAnimationFrame tick, and up to roughly 200ms before initiating the refresh. If I set the duration to 200ms of my transition then refresh sets the position perfectly. Is there anyway to increase/manually update the duration that ScrollTrigger.refresh(true) takes in order to allow for the transition to take place and then have the trigger position reset? Thanks
  8. Think I’ve solved this. Sorry for wasting anyone’s time…
  9. I’d like to try and do this functionality using vanilla.js only but have failed! I have created a codepen of where I’ve got to. The effect works perfectly on enter but I cant seem to get it to work when leaving and re-entering. If anyone can help solve this, would be very appreciative. Thanks in advance. https://codepen.io/jame5/pen/mdpPWEy
  10. I’m doing some research into how you can reveal/mask fixed elements which contain both text and SVG. I’d like to replicate how immerser.js works but use GSAP and ScrollTrigger instead. Is this possible and, if so, could you point me in the right direction? Thanks in advance.
  11. @Hirbod Thank you for kindly making further comment. Just to clarify you have removed registry=https://npm.greensock.com from the .npmrc file? And that everything works fine once this has been removed? I’m using this locally but will be deploying to Netlify so hoping it won’t throw up any errors!
  12. Thanks @Hirbod. Simply removing the @gsap: before registry=https://npm.greensock.com solved the issue for me as well... follow the instructions from there...
  13. Hi Zach Thanks for your quick response, as always. I just wanted to clear up whether ScrollTo would do the gruntwork of animating to sections on a different page, as you suggested, which I've taken from your message that it doesn't. So now I just to work out how to parse the URL for when the page loads. If you have any suggestion on how to do that, that would be gratefully received! Thanks again James
×