{"id":660,"date":"2012-10-26T12:02:09","date_gmt":"2012-10-26T12:02:09","guid":{"rendered":"http:\/\/codeatelier.wordpress.com\/?p=359"},"modified":"2012-10-26T12:02:09","modified_gmt":"2012-10-26T12:02:09","slug":"how-to-make-page-scroll-to-top","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/how-to-make-page-scroll-to-top\/","title":{"rendered":"How to make page scroll to top"},"content":{"rendered":"<p><strong>Scroll till top position is 0<\/strong><\/p>\n<pre>\n   $('html, body').animate({scrollTop:0}, 'slow');\n<\/pre>\n<p><strong>Scroll till top position is 100<\/strong><\/p>\n<pre>\n   $('html, body').animate({scrollTop:100}, 'slow');\n<\/pre>\n<p><strong>Scroll takes 2 seconds to complete<\/strong><\/p>\n<pre>\n   $('html, body').animate({scrollTop:100}, 2000);\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Scroll till top position is 0 $(&#8216;html, body&#8217;).animate({scrollTop:0}, &#8216;slow&#8217;); Scroll till top position is 100 $(&#8216;html, body&#8217;).animate({scrollTop:100}, &#8216;slow&#8217;); Scroll takes 2 seconds to complete $(&#8216;html, body&#8217;).animate({scrollTop:100}, 2000);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-660","post","type-post","status-publish","format-standard","hentry","category-jquery"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=660"}],"version-history":[{"count":0,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/660\/revisions"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}