I created a single page HTML with scrolling functionality. The structure of my divs - home and home2 - is as shown below. Both have a height of 100%. I am looking to add CSS to the second div (home2) using jQuery only when it becomes visible to the user in the browser. Can someone provide guidance on how to achieve this?
<div class="col-md-12 home" id="home">
<div class="col-md-6 col-md-offset-3 menu2">
<h1 class="home2head">Heading 1</h1>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
</div>
</div>
<div class="col-md-12 home2" id="home2">
<div class="col-md-6 menu2" id="menu2">
<h1 class="home2head">Heading 1</h1>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
<p>Some content will go here. Something about the hotel and its specialties.</p>
</div>
</div>
I am unsure of how to properly utilize $(window).scrollTop(), if that is a potential solution to my issue.