Creating Custom Monochromatic Cursor Effect in Divi

Fun Follow-the-Mouse effect with CSS Blend Modes!

In this short tutorial, I am going to show you how to recreate the custom cursor effect we recently included in the Black Friday Landing Page layout.

We are going to use the CSS mix-blend-mode property and some jQuery code to make it happen. Watch the step-by-step walkthrough video and copy the code we used below!

If you’re our subscriber feel free to download the JSON file!

Free Resources for Divi Lovers

Join our newsletter to get the good stuff!

We’ll provide you with updates on new tutorials, webdesign assets and special offers. Get top quality Divi goodies straight into your inbox! Read our Privacy Policy to learn how we manage and protect your submitted information.

Sign up to download

Get access to this layout and all the free resources made exclusively for our subscribers!

Already subscribed?

Fill the signup form and if you’re on the list it’ll get you straight to the download page! 

Can’t see the form? Click here

First, the Divi Builder structure

This is a simple two-column layout with bold typography. Using two different column colors allows for a surprising hover, follow-the-mouse experience. The content of each column can change, but it’s best to keep it in black/white colors only.

In our example, the parent section uses a custom CSS class of dl-bf-hero.

Next, the jQuery element

To make sure that the CSS mix-blend-mode property works across both columns, our cursor element needs to be a sibling of a parent row. The jQuery function below appends the new div with a CSS class of cursor inside the section (right after our row).

jQuery(document).ready(function($){
    $('.dl-bf-hero').append('<div class="cursor"></div>');
  });

Styling the element!

Here is the CSS code we used to style the new element:

.cursor {
    position: fixed;
    top:0;
    left:50%;
    width:400px;
    height:400px;
    background:#fff;
    border-radius:50%;
    z-index:2;
    mix-blend-mode:difference;
    transform:translate(-50%,-50%);
 }

Finally, move it with the cursor position!

This bit of jQuery will make sure, that the element top and left position are updated automatically when the user cursor position changes within the browser window.

$(window).mousemove(function(e){
      $('.cursor').css({
        top: e.clientY,
        left: e.clientX
      });
    });

And final jQuery code looks like this:

jQuery(document).ready(function($){
    $('.dl-bf-hero').append('<div class="cursor"></div>');
    $(window).mousemove(function(e){
      $('.cursor').css({
        top: e.clientY,
        left: e.clientX
      });
    });
  });

Here’s the final effect!

What do you think?

We would love to see how you might use this effect in action! Please share your creative ideas in the comments below!

We always appreciate your feedback, so let us know in the comments what you think!

Shares

Have you seen our

Divi child themes?

Divi Toolbox plugin?

We offer a great selection of high-quality Divi products to speed up your work. Feel free to use a coupon code IREADBLOG at the checkout to get a 10% discount!

11 Comments

  1. Elena

    This is awesome and just what I was looking for. But sadly it’s on the entire page, not only the row.
    And the circle is on top of the text, not transforming it like in your case.

    I also cannot import the design. Simply refuses to 🙁

    I hope you can somehow help making it work.

    Thanks.

    Reply
  2. olivier

    Hello, great tuto, but the effect is done on the whole page, how to have it only on the Black friday section.
    Thanks for your tutoros😉

    Reply
  3. LAFDAL STEPHANE

    Hi there, super effect, i would to know how to get this effect but only in the section (not all over my entire page =) )???

    Reply
  4. marta Caballero

    Hello, thank you very much for your tutorial, I love the effect. I have applied it on my website but it makes the links not clickable. Is there any way they work with the effect? If not, how could you make the effect only appear on the title banners and main banner?

    Reply
  5. Abhinav bhalla

    the import doesnt work anylonger with Divis latest version

    Reply
    • Ania Romańska

      It does work, please follow the donwload instructions. You need to import it to the page, not in the library.

      Reply
  6. Luisa

    Thank you, I love your tutorials and your way of explaining!

    Reply
  7. Hurri

    Thanks for taking the time to show us how to do this fun effect!
    I love your tutorials, they are so easy to follow and are always useful.

    Reply
  8. Wayne

    Thats clever – love it!!!

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Enjoing our content?

You might find this interesting…

License Details

REGULAR LICENSE

Single Site

A regular license allows an item to be used in one project for either personal or commercial use by you or on behalf of a client. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

EXTENDED LICENSE

Unlimited Sites

An extended license allows an item to be used in unlimited projects for either personal or commercial use. The item cannot be offered for resell either on its own or as a part of a project. Distribution of source files is not permitted.

SUPPORT & UPDATES

Each license is a one-time payment. There are no annual fees. You get lifetime access to product updates. Support is provided for 6 months from the date of purchase.

Server Requirements

SERVER SETTINGS:

  • PHP 7.2 or later
  • upload_max_filesize (256M)
  • max_input_time (300)
  • memory_limit (256M)
  • max_execution_time (300)
  • post_max_size (512M)

PHP.INI SETTINGS:

  • php-xml or/and php-dom
  • XMLReader
  • PHP CURL module

PHP MODULES:

  • allow_url_fopen

Would you like to...

Consult Ania and fellow students?

Join the conversation inside our private FB group.

Would you like to...

Get support privately?

Submit a support ticket via your account page.

Ask Ania?

Submit a question for the next live Q&A session.

Consult fellow students?

Join the conversation inside our private FB group.