0

Aquí esta El codigo de jQuery, es lo ultimo.introducir la descripción de la imagen aquí

Aquí esta el Htmlintroducir la descripción de la imagen aquí

Aquí esta donde quiero que se muevaintroducir la descripción de la imagen aquí

Pero des afortunadamente no hace nada, alguien me ayuda por favor? Gracias :D

1 respuesta 1

0

Esta forma funciona bastante bien:

JS:

   $(function(){

         $('a[href*=#]').click(function() {

         if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
             && location.hostname == this.hostname) {

                 var $target = $(this.hash);

                 $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');

                 if ($target.length) {

                     var targetOffset = $target.offset().top;

                     $('html,body').animate({scrollTop: targetOffset}, 1000);

                     return false;

                }

           }

       });

HTML:

Enlace que te llevará al sitio:

<a id="up" href="#to_up"> UP </a>

Y esto lo pones en el sitio donde quieres que te lleve:

<a name="to_up"></a>
1

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.