Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/06/2016, 07:49
kidinshell
 
Fecha de Ingreso: marzo-2013
Mensajes: 79
Antigüedad: 11 años, 10 meses
Puntos: 2
Respuesta: botón de mover página hasta un div

ya he solucionado mi problema, a quien le interese le dejo el código =)
Código HTML:
<html xmlns="http://www.w3.org/1999/xhtml" lang="es">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Anclas suaves con jQuery</title>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
		<script type="text/javascript">
		$(document).ready(function(){
			//nos desplazamos entre todos los divs
			$('a.ancla').click(function(e){
			e.preventDefault();
		    enlace  = $(this).attr('href');
		    $('html, body').animate({
		        scrollTop: $(enlace).offset().top
		    }, 1000);
			});
		});
		</script>

	</head>
	<body>
		<div id="contenedor" style="min-height: 2000px"><br />

							<div id="ancla">Este es el div número 5</div>
				<a href="#ancla" class="ancla" >Al div 5</a>

		</div>
	</body>
</html>