{"id":987,"date":"2017-05-23T10:50:32","date_gmt":"2017-05-23T08:50:32","guid":{"rendered":"http:\/\/divinotes.flywheelsites.com\/?p=987"},"modified":"2020-04-15T14:05:11","modified_gmt":"2020-04-15T12:05:11","slug":"create-image-scrolls-hover","status":"publish","type":"post","link":"https:\/\/divinotes.com\/create-image-scrolls-hover\/","title":{"rendered":"Create An Image That Scrolls Up When You Hover Over It"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;section&#8221; _builder_version=&#8221;3.22&#8243;][et_pb_row admin_label=&#8221;row&#8221; _builder_version=&#8221;3.25&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;3.27.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<p>Okay, I have to admit, I love this <strong>image scroll effect<\/strong>! It&#8217;s looks so cool and I&#8217;ve spotted it quite a few times in the wild recently. The best thing is, it&#8217;s actually quite easy to achieve in the <a href=\"http:\/\/www.elegantthemes.com\/affiliates\/idevaffiliate.php?id=22708_1_1_14\" target=\"_blank\" rel=\"noopener noreferrer\">Divi theme<\/a>. Before we go any further, let&#8217;s begin with an example.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;3.25&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; make_fullwidth=&#8221;off&#8221; use_custom_width=&#8221;off&#8221; width_unit=&#8221;on&#8221; column_structure=&#8221;1_2,1_2&#8243;][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;4.4.3&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; hover_enabled=&#8221;0&#8243; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<h2>Scrolling Image Example<\/h2>\n<p>As a web designer, one of the best use cases for this effect would be to show off my Divi layouts and also to show off the sites I&#8217;ve built on \u00a0a portfolio page.<\/p>\n<p>In this example I&#8217;ve made a full page screenshot of my first commercially available layout packed called <a href=\"http:\/\/divinotes.com\/free-premium-divi-theme-layouts\/beach-house-free-divi-layout-pack\/\" target=\"_blank\" rel=\"noopener noreferrer\">Beach House<\/a>. Hover your mouse over the image and watch as it glides effortlessly down the page.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][et_pb_column type=&#8221;1_2&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_css_main_element=&#8221;-webkit-box-shadow: 10px 10px 28px -3px rgba(0,0,0,0.5);||-moz-box-shadow: 10px 10px 28px -3px rgba(0,0,0,0.5);||box-shadow: 10px 10px 28px -3px rgba(0,0,0,0.5);&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text admin_label=&#8221;Scrolling BG Text&#8221; module_class=&#8221;slippery&#8221; _builder_version=&#8221;3.27.4&#8243; background_image=&#8221;http:\/\/divinotes.com\/wp-content\/uploads\/2017\/05\/Beach-House-Layout-Screenshot.jpg&#8221; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; text_orientation=&#8221;center&#8221; module_alignment=&#8221;center&#8221; custom_padding=&#8221;300px|||&#8221; custom_css_main_element=&#8221;margin-left: auto!important;||margin-right: auto!important;||transition: background-position 1.5s ease-out 0.5s;||background-position: top center;||background-size: 100% auto!important;||height: 100%;||background-repeat: no-repeat;&#8221; use_border_color=&#8221;off&#8221; saved_tabs=&#8221;all&#8221;][\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;3.25&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;3.27.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<h2>Get Scrolling With A Little CSS<\/h2>\n<p>Believe it or not, most of the magic happens in the humble little text module. In the example above, I&#8217;ve used a two column row with a text module in each.<\/p>\n<p>In the text module that you want to use for the scrolling image, place the image in the background field of the text module:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-large wp-image-994\" src=\"http:\/\/divinotes.com\/wp-content\/uploads\/2017\/05\/text-module-background-image-1024x519.png\" alt=\"\" width=\"1024\" height=\"519\" srcset=\"https:\/\/divinotes.com\/wp-content\/uploads\/2017\/05\/text-module-background-image-1024x519.png 1024w, https:\/\/divinotes.com\/wp-content\/uploads\/2017\/05\/text-module-background-image-300x152.png 300w, https:\/\/divinotes.com\/wp-content\/uploads\/2017\/05\/text-module-background-image-627x318.png 627w, https:\/\/divinotes.com\/wp-content\/uploads\/2017\/05\/text-module-background-image-610x309.png 610w, https:\/\/divinotes.com\/wp-content\/uploads\/2017\/05\/text-module-background-image.png 1032w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p>Next, go to the Design tab and in the <strong>Custom Padding Top<\/strong> field, set the value to the height you&#8217;d like your image to be. I&#8217;ve set mine to\u00a0300px.<\/p>\n<p>Now head on over to the Advanced tab, find the <strong>Custom CSS<\/strong> section\u00a0and add the following CSS to the <strong>Main Element<\/strong> section.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/robhob\/feaaaabb9cc5905aa54abdf7955e223b.js\"><\/script><\/p>\n<p>Next up, give your text module a CSS class name (you&#8217;ll find this near the top of the advanced tab). In this example, I&#8217;ve used the class name <em>slippery<\/em>.<\/p>\n<p>Now all that&#8217;s left to do is to add a little more CSS either at page level in the <strong>Divi Builder Setting<\/strong> widget at the top of the Divi Builder (look for the hamburger) or globally in the CSS file of the child theme (you better be using a <a href=\"https:\/\/quiroz.co\/5-easy-steps-to-creating-a-child-theme\/\" target=\"_blank\" rel=\"noopener noreferrer\">child theme<\/a>), or in the <strong>Divi Theme Options<\/strong> panel (look at the bottom of the General tab for the Custom CSS field). The following CSS is all that you need to add:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/robhob\/774edfaca90c56890f718f34661b57dd.js\"><\/script><\/p>\n<p>You can adjust the speed by changing the value of the\u00a0background-position from the 5s that I&#8217;ve used in the example above to the speed you&#8217;re happy with but don&#8217;t go too slow otherwise you&#8217;ll bore your visitors.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][et_pb_row _builder_version=&#8221;3.25&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;3.25&#8243; custom_padding=&#8221;|||&#8221; custom_padding__hover=&#8221;|||&#8221;][et_pb_text _builder_version=&#8221;3.27.4&#8243; background_size=&#8221;initial&#8221; background_position=&#8221;top_left&#8221; background_repeat=&#8221;repeat&#8221; use_border_color=&#8221;off&#8221; border_color=&#8221;#ffffff&#8221; border_style=&#8221;solid&#8221;]<\/p>\n<h2>Wrapping It Up<\/h2>\n<p>There you have it, your very own beautiful scrolling image. Just remember to put your images on a diet before you do this. If you need a little help in this department, check out my post on <a href=\"http:\/\/divinotes.com\/image-optimization-for-wordpress\/\">image optimization for WordPress<\/a>.<\/p>\n<p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Okay, I have to admit, I love this image scroll effect! It&#8217;s looks so cool and I&#8217;ve spotted it quite a few times in the wild recently. The best thing is, it&#8217;s actually quite easy to achieve in the Divi theme. Before we go any further, let&#8217;s begin with an example. Scrolling Image Example As [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1010,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[15,21],"tags":[66],"class_list":["post-987","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","category-ui","tag-scrolling-image","et-has-post-format-content","et_post_format-et-post-format-standard"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/posts\/987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/comments?post=987"}],"version-history":[{"count":5,"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/posts\/987\/revisions"}],"predecessor-version":[{"id":2977,"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/posts\/987\/revisions\/2977"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/media\/1010"}],"wp:attachment":[{"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/media?parent=987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/categories?post=987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/divinotes.com\/wp-json\/wp\/v2\/tags?post=987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}