Im binding an event handler that does an if check to find the presence of an element in the viewport of screen and adjust width of 4-5 elements.
Im not really sure how scroll event works in javascript. But my gut feeling is that, scroll event is fired for even the 1px scroll we do -- in which case scroll sounds more like a continuous event once we start scrolling fast(correct me if Im wrong here). If thats the case, wouldnt calculating viewport and checking the presence of an element inside it and doing dom manipulation would be too much of hit on the performance?
Please help me understand how the scroll event works if my assumption is wrong here!
Thanks.