By Viewport, I mean the "first viewport the user sees when they visit the webpage - before they have scrolled down".
So is it possible to change the
class
name of an element when the page is scrolled down to below the first viewport (that is the user has scrolled down to the point when 'the part of the page which was visible before scrolling down' is no more visible), and also change the value ofstyle
attribute, using CSS3 only?If I use JavaScript, can somebody tell me what is it that triggers the change of
background-color
- is it the invisibilty of the first viewport (because the current scroll position is below it on the page), or appearance of the content below the first viewport?By the way, what is the correct name for the part of a webpage which i am ridiculously calling the first viewport?