Reputation: 25
How can I disable .ssk-sticky on launch of website, then have it enabled upon user scroll.
I am using Social Share Kit API and have tried changing CSS display property to none, although this kills the social nav, so wondering if it can be done using JavaScript.
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('.ssk-sticky').fadeIn();
} else {
$('.ssk-sticky').fadeOut();
}
});
Upvotes: 0
Views: 123
Reputation: 12959
try this :
<script>
$(window).scroll(function () {
if ($(document).scrollTop() > 100) {
$('.ssk-sticky').fadeIn();
} else {
$('.ssk-sticky').fadeOut();
}
});
</script>
Upvotes: 1