Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------- CSS:
- .bottomtitle{
- position:fixed;
- font-size:50px;
- text-align:center;
- bottom:0;
- right:0;
- margin:0 50px 50px 0;
- color:{color:accent}!important;
- transition: all .5s;
- }
- .hide {
- opacity:0;
- }
- .show {
- opacity:1;
- }
- ---------------- HTML:
- <div id="myID" class="bottomtitle hide"><a href="/">{Title}</a></div>
- ---------------- SCRIPT:
- <script>
- myID = document.getElementById("myID");
- var myScrollFunc = function () {
- var y = window.scrollY;
- if (y >= 200) {
- myID.className = "bottomtitle show"
- } else {
- myID.className = "bottomtitle hide"
- }
- };
- window.addEventListener("scroll", myScrollFunc);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement