Hi all, thanks.
It works perfectly.
Going deep:
If I add a second <ul> // <ol> (on the same page) and I replicate the code, changing the selectors.. it doesnt work...
Any hint please?
let main_features_home = document.querySelector("ol.one-at-time");
if(main_features_home){
gsap.fromTo('ol.one-at-time li', {
y: 50,
opacity: 0
}, {
opacity: 1,
y: 0,
scrollTrigger: {
trigger: ".one-at-time",
start: "top 70%",
end: "bottom bottom+=70",
scrub: true,
markers: true,
}
});
}
Got a list of text, and need to make each of'em fadeIn, as the previous code. But both doesnt work together.
Full code then:
/*gsap*/
gsap.registerPlugin(ScrollTrigger);
//1
let main_features_home = document.querySelector("ol.one-at-time");
if(main_features_home){
gsap.fromTo('ol.one-at-time li', {
y: 50,
opacity: 0
}, {
opacity: 1,
y: 0,
scrollTrigger: {
trigger: "ol.one-at-time",
start: "top 70%",
end: "bottom bottom+=70",
scrub: true,
markers: true,
}
});
}
//2
let cont_ul_clienti = document.querySelector(".griglia-clienti-home ul");
if(cont_ul_clienti){
gsap.fromTo('.griglia-clienti-home ul li', {
y: 50,
opacity: 0
}, {
opacity: 1,
y: 0,
scrollTrigger: {
trigger: ".griglia-clienti-home",
start: "top 70%",
end: "bottom bottom+=70",
scrub: true,
markers: true,
}
});
}
Thanks all for helping