Skip to content

Instantly share code, notes, and snippets.

@helart
Last active August 15, 2020 18:42
Show Gist options
  • Save helart/bd4f2822a2e3753633c4 to your computer and use it in GitHub Desktop.
Save helart/bd4f2822a2e3753633c4 to your computer and use it in GitHub Desktop.
Botton UP
<html>
<head>
<style type="text/css">
.b-top {z-index:2600;position:fixed;left:0;bottom:90px;width:34%;margin-left:50%;opacity: 0.5;filter:alpha(opacity=50);}
.b-top:hover {opacity:1;filter:alpha(opacity=100);cursor:pointer;}
.b-top-but {z-index:2600;position:absolute;display:block;left:56px;bottom:0;margin:0 0 0 100%;padding:32px 12px 4px;
color:white;background:#D8D5C2 url(http://alaev.info/wp-content/plugins/goupbutt/b-j-top.png) no-repeat 50% 11px;border-radius:7px;}
</style>
<script type="text/javascript">$(document).ready(function(){
$(window).scroll(function () {if ($(this).scrollTop() > 0) {$('#scroller').fadeIn();} else {$('#scroller').fadeOut();}});
$('#scroller').click(function () {$('body,html').animate({scrollTop: 0}, 400); return false;});
});</script>
</head>
<body>
<div id="scroller" class="b-top" style="display: none;"><span class="b-top-but">наверх</span></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment