{"id":762,"date":"2010-09-19T11:07:41","date_gmt":"2010-09-19T10:07:41","guid":{"rendered":"http:\/\/www.paitadesign.com\/blog\/?p=762"},"modified":"2017-01-13T11:54:50","modified_gmt":"2017-01-13T10:54:50","slug":"jquery-smooth-scroll-scorrimento-morbido","status":"publish","type":"post","link":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/","title":{"rendered":"jQuery SmoothScroll: effetto scorrimento verticale morbido!"},"content":{"rendered":"<p>Vogliamo uno  <strong>scolling morbido per le ancore interne<\/strong> di una pagina web,<br \/>\nper creare <strong>link a sezioni interne di una pagina<\/strong>? Questo &egrave; un effetto molto utile per <a href=\"https:\/\/paitadesign.com\/blog\/jquery-e-web-designer-20-consigli-utili-e-trucchi-per-tutti-i-siti\/\" title=\"jQuery e Web Designer: 20+ consigli utili e trucchi per tutti i siti!\" target=\"_blank\">ogni tipo di progetto web<\/a>.<br \/>\nEcco di seguito come fare e il codice di esempio!<\/p>\n<p><!--more--><\/p>\n<div id=\"assetPanel\"><a class=\"assetCode\" title=\"Scarica tutte le risorse per questo tutorial\"href=\"http:\/\/www.paitadesign.com\/examples\/jQuery-smooth-scroll\/jQuery-smooth-scroll_risorse.zip\" target=\"_blank\">Risorse<\/a><a class=\"assetDemo\" title=\"Visualizza il risultato finale\" href=\"http:\/\/www.paitadesign.com\/examples\/jQuery-smooth-scroll\/jQuery-smooth-scroll_demo.html\" target=\"_blank\">Demo<\/a><\/div>\n<h2>Creiamo le ancore<\/h2>\n<p>Una tipologia di siti web che sta recentemente prendendo piede &egrave; il &quot;<a href=\"http:\/\/thedesignmag.com\/24-awesome-single-page-portfolio-designs.html\" title=\"24 Awesome Single Page Portfolio Designs \" target=\"_blank\">Vertical Portfolio<\/a>&quot;, cio&egrave; un sito web di una <strong>sola pagina che si sviluppa in verticale<\/strong>. <br \/>\n  Sostanzialmente, per creare questo effetto, si fa uso degli <strong>ancoraggi interni alla pagina web<\/strong>: utilizzando l&#8217;attributo <code>name<\/code> specifichiamo il nome dell&#8217;ancoraggio e impostiamo cos&igrave; il <em>segnalibro<\/em> all&#8217;interno del  documento <acronym title=\"HyperText Markup Language\">HTML<\/acronym>. <br \/>\n  Questi segnalibri non vengono visualizzati in alcun modo particolare,  sono invisibili all&#8217;utente, ma servono per spostare la pagina fino a quel determinato punto.<br \/>\nEcco un esempio:<\/p>\n<pre name=\"codice\" class=\"xhtml\">\r\n\t<a href=\"#nome-della-sezione\">Vai a Nome della sezione<\/a>\r\n\t\t...\r\n\t<h2>\r\n\t\t<a name=\"nome-della-sezione\"><\/a>Nome della sezione\r\n\t<\/h2>\r\n\t<p>Testo della sezione<\/p>\r\n<\/pre>\n<h2>jQuery: come rendere fluido lo scorrimento delle pagine web?<\/h2>\n<p>Notiamo che il passaggio da una sezione a un&#8217;altra non &egrave; fluido. <br \/>\n  Per ottenere questo effetto, cio&egrave; l&#8217;<strong>effetto scorrimento verticale morbido<\/strong>, possiamo usare la libreria <a href=\"https:\/\/paitadesign.com\/blog\/jquery_imparare_le_basi_facilmente_e_velocemente_toggle_mostrare_nascondere\/\" title=\"jQuery: impariamo le basi.\" target=\"_blank\">JavaScript jQuery<\/a>. <br \/>\nEcco qual&#8217;&egrave; il codice da inserire:<\/p>\n<pre name=\"codice\" class=\"javascript\">\r\n$('a[href*=#]').click(function() {\r\n\tif (location.pathname.replace(\/^\\\/\/,'') == this.pathname.replace(\/^\\\/\/,'')\r\n  && location.hostname == this.hostname) {\r\n  var $target = $(this.hash);\r\n  $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');\r\n  if ($target.length) {\r\n  var targetOffset = $target.offset().top;\r\n  $('html,body').animate({scrollTop: targetOffset}, 1000);\r\n  return false;}\r\n  }\r\n });\r\n<\/pre>\n<div class=\"resources\">\n<h3>Letture consigliate<\/h3>\n<p><a href=\"http:\/\/blog.medianotions.de\/en\/articles\/2009\/smoothscroll-for-jquery\" title=\"\u201csmooth\u201d scrolling within a page, from one anchor to the next.\" target=\"_blank\">SmoothScroll for jQuery<\/a><br \/>\n<a href=\"http:\/\/blog.freelancer-id.com\/index.php\/2009\/03\/26\/scroll-window-smoothly-in-jquery\" title=\"Using jQuery animate() function to do a smooth scrolling:\" target=\"_blank\">Scroll window smoothly in jQuery &#8211; Animated scroll<\/a><br \/>\n<a href=\"http:\/\/css-tricks.com\/snippets\/jquery\/smooth-scrolling\/\" title=\"smooth page scroll to an anchor on the same page\" target=\"_blank\">CSS tricks: Smooth Scrolling<\/a><br \/>\n<a href=\"http:\/\/www.thewebsqueeze.com\/web-design-tutorials\/create-a-horizontal-scrolling-website.html\" title=\"Tutorial for horizontal scrolling site.\" target=\"_blank\">How to: Create a Horizontal Scrolling Website<\/a><br \/>\n<a href=\"http:\/\/www.imnotsuperman.com\/2010\/jquery-tips-smooth-scroll-scolling-morbido-per-le-ancore-interne-a-una-pagina-web\/ \" title=\"smooth scroll, scolling morbido per le ancore interne a una pagina web\" target=\"_blank\">jQuery Smooth Scroll: scolling morbido per le ancore interne<\/a><br \/>\n<a href=\"http:\/\/vandelaydesign.com\/blog\/web-development\/jquery-one-page-portfolios\/\" title=\"jQuery Resources for One-Page Portfolios\" target=\"_blank\">One-Page Portfolios: all the jQuery Resources you need<\/a><br \/>\n<a href=\"http:\/\/www.rigacci.org\/docs\/biblio\/online\/html40it\/struct\/links.html\" title=\"Introduzione ai collegamenti e riferimenti\" target=\"_blank\">Introduzione ai collegamenti e riferimenti<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>jQuery: Scolling morbido per le ancore interne di una pagina web, per creare link a sezioni interne di una pagina. &hellip; <a href=\"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/\" class=\"more-link\"><span class=\"more-button\">Continue reading<span class=\"screen-reader-text\">jQuery SmoothScroll: effetto scorrimento verticale morbido!<\/span><\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[35,4],"tags":[68,127,69,67,40,122],"class_list":["post-762","post","type-post","status-publish","format-standard","hentry","category-jquery","category-webdesign","tag-anchor","tag-jquery","tag-scroll","tag-smooth","tag-usabilita","tag-webdesign"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>jQuery SmoothScroll: effetto scorrimento verticale morbido! - paitadesignblog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"jQuery SmoothScroll: effetto scorrimento verticale morbido! - paitadesignblog\" \/>\n<meta property=\"og:description\" content=\"jQuery: Scolling morbido per le ancore interne di una pagina web, per creare link a sezioni interne di una pagina. &hellip; Continue readingjQuery SmoothScroll: effetto scorrimento verticale morbido!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/\" \/>\n<meta property=\"og:site_name\" content=\"paitadesignblog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/giacomo.paita\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/giacomo.paita\" \/>\n<meta property=\"article:published_time\" content=\"2010-09-19T10:07:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-01-13T10:54:50+00:00\" \/>\n<meta name=\"author\" content=\"Giacomo Paita\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/giacomopaita\" \/>\n<meta name=\"twitter:site\" content=\"@giacomopaita\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"Giacomo Paita\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minuto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/\"},\"author\":{\"name\":\"Giacomo Paita\",\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/#\\\/schema\\\/person\\\/fa751c87d5208dca68eecbf09682ca4c\"},\"headline\":\"jQuery SmoothScroll: effetto scorrimento verticale morbido!\",\"datePublished\":\"2010-09-19T10:07:41+00:00\",\"dateModified\":\"2017-01-13T10:54:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/\"},\"wordCount\":230,\"publisher\":{\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/#\\\/schema\\\/person\\\/fa751c87d5208dca68eecbf09682ca4c\"},\"keywords\":[\"anchor\",\"jQuery\",\"scroll\",\"smooth\",\"usabilit\u00e0\",\"Webdesign\"],\"articleSection\":[\"jQuery\",\"Webdesign\"],\"inLanguage\":\"it-IT\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/\",\"url\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/\",\"name\":\"jQuery SmoothScroll: effetto scorrimento verticale morbido! - paitadesignblog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/#website\"},\"datePublished\":\"2010-09-19T10:07:41+00:00\",\"dateModified\":\"2017-01-13T10:54:50+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/jquery-smooth-scroll-scorrimento-morbido\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"jQuery SmoothScroll: effetto scorrimento verticale morbido!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/\",\"name\":\"paitadesignblog\",\"description\":\"HTML, CSS e tutto il resto\",\"publisher\":{\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/#\\\/schema\\\/person\\\/fa751c87d5208dca68eecbf09682ca4c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/#\\\/schema\\\/person\\\/fa751c87d5208dca68eecbf09682ca4c\",\"name\":\"Giacomo Paita\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/wp-content\\\/uploads\\\/img-post\\\/giacomo-paita.png\",\"url\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/wp-content\\\/uploads\\\/img-post\\\/giacomo-paita.png\",\"contentUrl\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/wp-content\\\/uploads\\\/img-post\\\/giacomo-paita.png\",\"width\":202,\"height\":220,\"caption\":\"Giacomo Paita\"},\"logo\":{\"@id\":\"https:\\\/\\\/paitadesign.com\\\/blog\\\/wp-content\\\/uploads\\\/img-post\\\/giacomo-paita.png\"},\"sameAs\":[\"http:\\\/\\\/www.paitadesign.com\",\"https:\\\/\\\/www.facebook.com\\\/giacomo.paita\",\"https:\\\/\\\/www.instagram.com\\\/giacomo.paita\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/giacomopaita\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/giacomopaita\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jQuery SmoothScroll: effetto scorrimento verticale morbido! - paitadesignblog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/","og_locale":"it_IT","og_type":"article","og_title":"jQuery SmoothScroll: effetto scorrimento verticale morbido! - paitadesignblog","og_description":"jQuery: Scolling morbido per le ancore interne di una pagina web, per creare link a sezioni interne di una pagina. &hellip; Continue readingjQuery SmoothScroll: effetto scorrimento verticale morbido!","og_url":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/","og_site_name":"paitadesignblog","article_publisher":"https:\/\/www.facebook.com\/giacomo.paita","article_author":"https:\/\/www.facebook.com\/giacomo.paita","article_published_time":"2010-09-19T10:07:41+00:00","article_modified_time":"2017-01-13T10:54:50+00:00","author":"Giacomo Paita","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/giacomopaita","twitter_site":"@giacomopaita","twitter_misc":{"Scritto da":"Giacomo Paita","Tempo di lettura stimato":"1 minuto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/#article","isPartOf":{"@id":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/"},"author":{"name":"Giacomo Paita","@id":"https:\/\/paitadesign.com\/blog\/#\/schema\/person\/fa751c87d5208dca68eecbf09682ca4c"},"headline":"jQuery SmoothScroll: effetto scorrimento verticale morbido!","datePublished":"2010-09-19T10:07:41+00:00","dateModified":"2017-01-13T10:54:50+00:00","mainEntityOfPage":{"@id":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/"},"wordCount":230,"publisher":{"@id":"https:\/\/paitadesign.com\/blog\/#\/schema\/person\/fa751c87d5208dca68eecbf09682ca4c"},"keywords":["anchor","jQuery","scroll","smooth","usabilit\u00e0","Webdesign"],"articleSection":["jQuery","Webdesign"],"inLanguage":"it-IT"},{"@type":"WebPage","@id":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/","url":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/","name":"jQuery SmoothScroll: effetto scorrimento verticale morbido! - paitadesignblog","isPartOf":{"@id":"https:\/\/paitadesign.com\/blog\/#website"},"datePublished":"2010-09-19T10:07:41+00:00","dateModified":"2017-01-13T10:54:50+00:00","breadcrumb":{"@id":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/paitadesign.com\/blog\/jquery-smooth-scroll-scorrimento-morbido\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/paitadesign.com\/blog\/"},{"@type":"ListItem","position":2,"name":"jQuery SmoothScroll: effetto scorrimento verticale morbido!"}]},{"@type":"WebSite","@id":"https:\/\/paitadesign.com\/blog\/#website","url":"https:\/\/paitadesign.com\/blog\/","name":"paitadesignblog","description":"HTML, CSS e tutto il resto","publisher":{"@id":"https:\/\/paitadesign.com\/blog\/#\/schema\/person\/fa751c87d5208dca68eecbf09682ca4c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/paitadesign.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":["Person","Organization"],"@id":"https:\/\/paitadesign.com\/blog\/#\/schema\/person\/fa751c87d5208dca68eecbf09682ca4c","name":"Giacomo Paita","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/paitadesign.com\/blog\/wp-content\/uploads\/img-post\/giacomo-paita.png","url":"https:\/\/paitadesign.com\/blog\/wp-content\/uploads\/img-post\/giacomo-paita.png","contentUrl":"https:\/\/paitadesign.com\/blog\/wp-content\/uploads\/img-post\/giacomo-paita.png","width":202,"height":220,"caption":"Giacomo Paita"},"logo":{"@id":"https:\/\/paitadesign.com\/blog\/wp-content\/uploads\/img-post\/giacomo-paita.png"},"sameAs":["http:\/\/www.paitadesign.com","https:\/\/www.facebook.com\/giacomo.paita","https:\/\/www.instagram.com\/giacomo.paita\/","https:\/\/www.linkedin.com\/in\/giacomopaita\/","https:\/\/x.com\/https:\/\/twitter.com\/giacomopaita"]}]}},"_links":{"self":[{"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/posts\/762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/comments?post=762"}],"version-history":[{"count":16,"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/posts\/762\/revisions"}],"predecessor-version":[{"id":1229,"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/posts\/762\/revisions\/1229"}],"wp:attachment":[{"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/media?parent=762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/categories?post=762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/paitadesign.com\/blog\/wp-json\/wp\/v2\/tags?post=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}