-
-
Save agentquay/f05d0accad3fa412a65a81e42e660bd6 to your computer and use it in GitHub Desktop.
Appear after scroll depth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#rum_sst_tab { | |
opacity: 0; | |
transition: all .5s; | |
visibility: hidden; | |
} | |
#rum_sst_tab.show { | |
opacity: 1; | |
visibility: visible; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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