Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a href="#" class="scrollup">Scroll</a>
- <script type="text/javascript">
- $(document).ready(function(){
- $(window).scroll(function(){
- if ($(this).scrollTop() > 100) {
- $('.scrollup').fadeIn();
- } else {
- $('.scrollup').fadeOut();
- }
- });
- $('.scrollup').click(function(){
- $("html, body").animate({ scrollTop: 0 }, 600);
- return false;
- });
- });
- </script>
- <style>
- .scrollup{
- width:64px;
- height:64px;
- opacity:0.5; /*Здесь можете менять значение от 0 до 1*/
- position:fixed;
- bottom:500px;
- right:20px;
- display:none;
- text-indent:-9999px;
- background: url(https://sites.google.com/site/poleznoznat/r2.png) no-repeat; /*Путь к картинке, на которую будут нажимать для подъема наверх страницы*/
- outline:0;
- }
- </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement