{"id":118,"date":"2014-06-23T01:09:09","date_gmt":"2014-06-23T01:09:09","guid":{"rendered":"http:\/\/html5box.com\/blog\/?p=118"},"modified":"2014-06-23T01:10:30","modified_gmt":"2014-06-23T01:10:30","slug":"jump-to-top-when-video-thumbnail-is-clicked","status":"publish","type":"post","link":"https:\/\/html5box.com\/blog\/jquery-video-gallery\/jump-to-top-when-video-thumbnail-is-clicked\/","title":{"rendered":"Jump to top when thumbnail is clicked"},"content":{"rendered":"<p><strong>Question:<\/strong><\/p>\n<p>Is it possible to make the page \u2018jump\u2019 back to the top (where the video container is) if a viewer has scrolled down to click thumbnail, so one click is enough anywhere in the thumbnail list, to play the video.<\/p>\n<p><strong>Answer:<\/strong><\/p>\n<p>You can take the following steps (only for version 3.2 and after):<\/p>\n<p>1.  Add the following the JavaScript to the head section, before <\/head><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;script language=&quot;JavaScript&quot;&gt;\r\n    function jumpToTop(data) {\r\n    \twindow.scrollTo(0, 300);\r\n    }\r\n&lt;\/script&gt;\r\n<\/pre>\n<p>You can change the 300 to your desired value.<\/p>\n<p>2.  Add the following data tag to the div:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\ndata-onthumbclick=&quot;jumpToTop&quot; \r\n<\/pre>\n<p>You can view the updated demo page <a href=\"http:\/\/html5box.com\/html5gallery\/demo_mediacenter.php\" target=\"_blank\">http:\/\/html5box.com\/html5gallery\/demo_mediacenter.php<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: Is it possible to make the page \u2018jump\u2019 back to the top (where the video container is) if a viewer has scrolled down to click thumbnail, so one click is enough anywhere in the thumbnail list, to play the video. Answer: You can take the following steps (only for version 3.2 and after): 1. &hellip; <a href=\"https:\/\/html5box.com\/blog\/jquery-video-gallery\/jump-to-top-when-video-thumbnail-is-clicked\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Jump to top when thumbnail is clicked<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-jquery-video-gallery"],"_links":{"self":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":3,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/posts\/118\/revisions\/121"}],"wp:attachment":[{"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/html5box.com\/blog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}