Skip to content

Instantly share code, notes, and snippets.

@agentquay
Last active May 29, 2019 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agentquay/f05d0accad3fa412a65a81e42e660bd6 to your computer and use it in GitHub Desktop.
Save agentquay/f05d0accad3fa412a65a81e42e660bd6 to your computer and use it in GitHub Desktop.
Appear after scroll depth
#rum_sst_tab {
opacity: 0;
transition: all .5s;
visibility: hidden;
}
#rum_sst_tab.show {
opacity: 1;
visibility: visible;
}
$(document).scroll(function () {
var y = $(this).scrollTop();
var scrollHeight = 500;//Set the number to your desired distance from the top
if (y > scrollHeight) {
$("#rum_sst_tab").addClass("show");
} else {
$('#rum_sst_tab').removeClass("show");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment