Created
November 26, 2017 08:41
-
-
Save AndreaBarghigiani/942f339ad29013928fad1d1de4d5e2b7 to your computer and use it in GitHub Desktop.
Codice in commento ricevuto su https://skillsandmore.org/usare-javascript-wordpress/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut odio. Nam sed est. Nam | |
risus et est iaculis adipiscing. Vestibulum ante ipsum primis in faucibus orci luctus | |
ultrices posuere cubilia Curae; Integer ut justo. In tincidunt viverra nisl. Donec dictum | |
malesuada magna. Curabitur id nibh auctor tellus adipiscing pharetra. | |
<a href="#torna-su" rel="nofollow">Torna su</a> | |
jQuery(document).ready(function() | |
{ | |
function ScorriPagina(Posizione, Velocita) | |
{ | |
jQuery("html,body").animate({scrollTop: Posizione}, Velocita, function(){}); | |
return false; | |
} | |
jQuery(".torna-su").click(function() | |
{ | |
//Lo scroll avverrà per 0 pixel (e cioè posizione da raggiungere) ad una velocità di 1 secondo | |
ScorriPagina(0, 1000); | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment