In order for the plugin to function correctly, it is necessary that all children are enclosed within a single wrapping element.
Based on your HTML code, the .content
acts as a wrapper for each instance of .stuff
.
Your HTML structure should resemble the following:
<div class="content">
<div class="stuff" style="background-color:#D95153;"> </div>
<div class="stuff" style="background-color:#967D7D;"> </div>
<div class="stuff" style="background-color:#ADA1A2;"> </div>
</div>
To ensure that each child element occupies 100% height of the window, you can utilize jQuery.
Remember to initialize the plugin only after its construction is complete.
Include the following code snippet after constructing the plugin:
$(function() {
$(".stuff").height($(window).height());
$(".content").snapscroll();
});
If you want to view an updated example, check out this link: CHECK THIS UPDATED FIDDLE