Jump to content
Search Community

How to get DOM elements x position after animation

Wizard of Oz test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

Hi, I am trying to recreate this gallery: https://nation.africa/kenya/photos/lifestyle/oscars-2023-winners-celebrate-4156402
 

My plan is to animate in a new card by altering the parent divs' getBoundingClientRect x value on each button click.
1. But when I print the values on the console after the animation runs, I don't see any change in any of the "elemRect" values. Why is that?
2. What would be a smart way of identifying that I've reached the end of my gallery?
3. There is a hitch where I need to press both buttons 2 times for them to navigate in the different direction, any idea what's causing that?

Thanks for any advice 

See the Pen NWLJOxg?editors=1111 by martinkariuki7-the-looper (@martinkariuki7-the-looper) on CodePen

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...