Imagine I'm using the following code on my website
<div class="wrapper">
<nav class="main-nav">
Hello, I am navigation
</nav>
</div>
When an object with the selector "wrapper"
is within the viewport, I would like to reference an additional selector in the <nav>
element.
Therefore
When an element with "wrapper" is in the viewport, the HTML is
<div class="wrapper">
<nav class="main-nav in-view">
Hello, I am navigation
</nav>
</div>
Otherwise the code is
<div class="wrapper">
<nav class="main-nav">
Hello, I am navigation
</nav>
</div>