First time seeking help on here, hoping there is a simple answer for this. I am using AOS - Animate on Scroll library in my website and I want to be able to change the aos delay value based on the screen width as I need different delay times depending on screen size.
Is it possible to call the below “1300” value something like “number” and then have that value changed by media queries in either CSS or javascript?
<div class="skill" data-aos="fade-in" data-aos-delay="1300">
<div class="icon-container">
<img src="images/pencilruler.gif" alt="">
</div>
<h1>Graphic Design</h1>
<p>
Custom designs for screen and print. From logo designs and corporate branding, to adverts and packaging.
</p>
</div>
I have have had no luck finding a solution to this. I tried using getElementById() in javascript but could only manage to change the content of the div and not a value within it.
At the moment my workaround (below) is to have duplicate divs for each delay length and then by using ‘display:none;’ I can remove the unneeded ones based on screen size. This is a real pain and a bit messy as there is quite a few delay variations that I want.
@media screen and (max-width : 419px){
.skill-desktop{
display:none;
}
}
Appreciate any help or ideas.