<style> div#top { background: rgba(0, 0, 0, 0) url('/images/arrow-up.png') no-repeat scroll 0 0; background-size: cover; float: right; height: 40px; padding: 0 0 0 40px; position: fixed; right: 10px; bottom: 10px; z-index: 6; cursor: pointer; } </style> <div id="top" title="Наверх"></div> <script> $(document).ready(function () { var top_show = 300; var delay = 1000; $( document ).ready( function () { $( window ).scroll( function () { if ( $( this ).scrollTop() > top_show ) $( '#top' ).fadeIn(); else $( '#top' ).fadeOut(); } ); if ( $( this ).scrollTop() > top_show ) $( '#top' ).fadeIn(); else $( '#top' ).fadeOut(); $( '#top' ).click( function () { $( 'body, html' ).animate( { scrollTop: 0 }, delay ); } ); } ); }) </script>