-
AuthorPosts
-
July 3, 2024 at 10:43 pm #1461264
Hello,
i use a script to add a class to four images in order to start an animation on my site “vernissageduvar.com”;
I made it with animation and keyframe and it’s working until i arrive under 400 pixels wide with the adaptativ view tool of Firefox.
My animation starts when i arrive to the title “Nos réalisations” in the middle of the page “vernissageduvar.com”. it happens only one time.Is there something special under 400 pixels wide on Enfold?
July 5, 2024 at 6:08 am #1461408Hey pierremartin311,
Thank you for the inquiry.
The animation only starts when we scroll down to the “Nos réalisations” section. Is this the intended behavior? There’s nothing notably different in how the site is rendered under 400px.
Best regards,
IsmaelJuly 5, 2024 at 6:21 am #1461409Hello,
yes, i told you that it start only when you arrive to this place.
So why when i put résolution at 400px large it works and 399 i can’t see anything?July 5, 2024 at 6:26 am #1461411So i can’t see my animation on some mobiles… I notice too that under 400px large, i have to put some ” !important” to make things work…
July 5, 2024 at 6:43 am #1461413Hi!
Thanks for the info.
We can still see the animation when the screen width is lower than 399px and even smaller than that. However, please note that as of 2024, the smallest smartphone screen resolutions typically found are around 720 x 1440 pixels, so this shouldn’t be an issue for most visitors.
Cheers!
IsmaelJuly 5, 2024 at 6:51 am #1461415So, i just see that if i don’t use the script it works on small screen!
it seems that on screen under 400px large, the script don’t works…here is my script:
<script> function scrollTrigger(selector, options = {}){ let els = document.querySelectorAll(selector) els = Array.from(els) els.forEach(el => { addObserver(el, options) }) } function addObserver(el, options){ if(!('IntersectionObserver' in window)){ if(options.cb){ options.cb(el) }else{ entry.target.classList.add('active') } return } let observer = new IntersectionObserver((entries, observer) => { //this takes a callback function which receives two arguments: the elemts list and the observer instance entries.forEach(entry => { if(entry.isIntersecting){ if(options.cb){ options.cb(el) }else{ entry.target.classList.add('active') } observer.unobserve(entry.target) } }) }, options) observer.observe(el) } // Example usages: scrollTrigger('.intro-text') scrollTrigger('.scroll-reveal', { rootMargin: '-200px', }) scrollTrigger('.loader', { rootMargin: '-200px', cb: function(el){ el.innerText = 'Loading...' setTimeout(() => { el.innerText = 'Task Complete!' }, 1000) } }) </script>
July 5, 2024 at 6:54 am #1461417I have an iphone 8 and it doesn’t work with the script…. i know Iphone 8 is not so recent but..
July 5, 2024 at 6:58 am #1461419Hi,
Thank you for the update.
Which browser are you using on iPhone 8? If it’s an outdated browser, it’s possible that it doesn’t support the IntersectionObserver feature, which could be why the script is not working as expected.
Best regards,
IsmaelJuly 5, 2024 at 7:07 am #1461422So, i found my problem. I changed the rootMargin “-200” by “0” in my script and it works now on my Iphone..
July 5, 2024 at 7:10 am #1461423The problem is that i know nothing in java and i took this script somewhere on the net without understanding really how it works…
July 5, 2024 at 7:52 am #1461425 -
AuthorPosts
- The topic ‘Animation display problem under 400px…’ is closed to new replies.