@mvaneijgen Hey Hey, I am back with a new query, Currently, I made the text in the above cards clickable, In such a way that if I click on the 3rd one, it should scroll past the second and show the third card, I was able to achieve this while clicking on card 2 and card 3 or directly clicking on card 3 skipping card2.....but when try to go back from card 3 to card 2, it scrolls down and but not to card 2
function clickedElement(clickedElement) {
const parentElement = clickedElement.parentNode
const parentId = parentElement.id
let left = $(parentElement).offset().left
let targetOffset = $(parentElement).offset().top + left - $(parentElement).outerHeight();
console.log($(parentElement).offset().left)
console.log($(parentElement).offset())
const currentScroll = window.scrollY
let offset = targetOffset;
gsap.to(window, {
duration: 0.5,
scrollTo: {
y: offset,
offsetY: 0
}
})
}
this is what I used for it.....I am using left too as the offset.top() is same for all elements as they are horizontally stacked, this has very less of gsap used but any help would be appreciated as I am raking my brain over this
Thank you