White Arrow icon
Back to all Elements

Hover to reveal Mask

A fixed background image that is revealed by mouse hover all over the section

I recreated this codepen by @suez in Webflow.

Create the following hierarchy:

  1. Full page div/section
  2. Add a div with the size and shape of your mask revealer and a background image of your choice and position:absolute. Place it inside the full page section.
  3. Paste this code to your page custom code section, before </body> tag:

<script>
$(document).ready(function() {
 var $magic = $(".hover-div"),
     magicWHalf = $magic.width() / 2;
 $(document).on("mousemove", function(e) {
   $magic.css({"left": e.pageX - magicWHalf, "top": e.pageY - magicWHalf});
 });
});
</script>

Copy
  1. Replace the ".hover-div" with your Madk div classname (replace only the hover-div, keep the " " and the .
  2. Publish :) 

Preview:

Share:

When your bath soap bar gets too small to use, don't throw it away! open the next bar, and when you finish showering, stick the small old bar to the back of the new bar. Onces they both dry, they will become one.

Might also interest you:

Symbol in RichText

Cloneable
CMS
Code

Insert a symbol element into a RichText. On a static or dynamic page.

Read more
White Arrow icon

Round Scroll Indicator / Progress Bar

Cloneable
Interactions
Animation

A round scroll indicator mad with Webflow elements and interactions

Read more
White Arrow icon

Pass Parameters

Cloneable
Code

Pass input fields parameters and add them to the destination URL.

Read more
White Arrow icon