Welcome to my first post on this platform! I'm currently in the process of creating a portfolio website featuring long panoramic photographs displayed within scrollable divs. You can check it out here: www.edentan.co.uk/portfolio.html. My challenge right now is overlaying a GIF onto one of these photos, but positioning it precisely on the image seems tricky. It seems like using JavaScript may be necessary as simply using CSS for positioning restricts me to determining the position based on pixels from the screen edge.
var imageFive = document.getElementById("Img5").style.left = 500%
The code snippet above does work, but the issue lies in how the position varies with different screen resolutions. What I aim to accomplish is having .style.left operate similarly to how I've scrolled left using the script provided below.
var imageThree = document.getElementById('Img3')
var widthImg3 = imageThree.clientWidth;
const Img3El = document.querySelector('#Div3');
Img3El.scrollLeft = widthImg3/1.26;
In essence, I want to style.left Img5 by a fraction relative to Img3, yet I'm struggling to formulate the script to achieve this goal. Any assistance would be greatly appreciated, and thank you for taking the time to read through my request!