
Añadimos el siguiente código:
<script type="text/javascript">
$(function(){$window=$(window);$link=$("#scrollToTop");$link.click(function(){$("html, body").animate({scrollTop:0},"slow")});$window.scroll(function(){if($window.scrollTop()<=0){$link.fadeOut("fast")}else{$link.fadeIn("fast")}})});
</script>
<style type="text/css">
#scrollToTop:link, #scrollToTop:visited {
display: none;
width: 40px;
height: 40px;
position: fixed;
top: 10px;
z-index: 9999;
right: 35px;
opacity: 0.5;
cursor: pointer;
}
#scrollToTop:hover, #scrollToTop:active {
display: none;
width: 40px;
height: 40px;
position: fixed;
top: 10px;
z-index: 9999;
right: 35px;
opacity: 0.8;
cursor: pointer;
}
</style>
<a href="javascript:;" id="scrollToTop"><img src="http://i.imgur.com/0am8n.png"/></a>


- Compartir en:
No hay comentarios:
Publicar un comentario