I am using jQuery scrollify plugin on my website. It works great but I need to have custom offset for different areas of the page. For example all my section elements should have an offset of -200 while 2 footer elements should have an offset of -100px and -50px. This can't be achieved just by using interstitialSection. Can anyone please suggest a solution for this?
HTML
<header>
....
</header>
<section>
</section>
....
//removed for brevity
....
<footer class="contact">
</footer>
<footer class="social-footer">
</footer>
JS
$.scrollify({
section: "header, section, footer",
interstitialSection: "header, section, .contact, .social-footer",
offset: -200,
//this doesn't seem to work
before: function (indexPosition, snapToElm) {
if (indexPosition === 1) {
snapToElm[indexPosition].css({ "margin-top": "200px" });
} else if (indexPosition === 2) {
snapToElm[indexPosition].css({ "margin-top": "100px" });
} else if (indexPosition === 3) {
snapToElm[indexPosition].css({ "margin-top": "150px" });
}
},
afterRender: function () {
//Picked up from another source
//set the first element initially to the desired offset
$($(this.section)[0]).css({ "margin-top": "200px" });
}
});