This is my code, I want them to be activated when I scroll down or up, not by clicking on them
<input type="radio" name="buttons" id="r1" checked> <input type="radio" name="buttons" id="r2"> <input type="radio" name="buttons" id="r3"> <input type="radio" name="buttons" id="r4"> <div class="controls"> <label for="r1"><span></span>LAB & Process Development</label> <label for="r2"><span></span>Quality & Regulatory</label> <label for="r3"><span></span>Engineering & Project Management</label> <label for="r4"><span></span>EHS</label> </div>
thank you for helping me
I don't quite understand what you want to achieve.
However, if you want to do anything on scroll, you should listen to scroll events. You have two options:
The first situation:
Second case:
Edit: As requested in the comments. It depends on how you want to achieve this. For example, you might want to check each radio by looping:
This is a very simple implementation and can be improved.