Custom mouse cursor website with Elementor Pro (NO PLUGIN)
hello, I’m Kaycinho, The Digital Alchemist, and today I’m going to teach you how to create a custom mouse cursor that magically snaps to elements, and we’ll do that with Elementor Pro coupled with a script.
Let’s give credit where it’s due: this tutorial is based on the great, yet lightweight MagicMouse.JS script.
Custom Mouse Cursor With Elementor Pro Tutorial
This tutorial is video based of course, but in case you need some time stamps :
- 0:00 – Custom mouse cursor website with Elementor Pro (NO PLUGIN)
- 0:30 – What we’re going to build
- 1:14 – The magic we’ll be using
- 1:45 – Pre-requisites
- 2:18 – Setting up the custom cursor
- 5:30 – Tweaking the options
Css Code
Step 1 – Magic Mouse
In Wp > Elementor > Custom Code -> create a new document with the following code:
Step 2 – Magic Options
In Wp > Elementor > Custom Code -> create a new document with the following code:
Step 3 – Magic Css
While editing any page with Elementor Pro, click on the hamburger icon in the top left of the window, the click on Site Settings > Custom Css and paste the following code:
@media only screen and (min-width: 1367px) {
body #magicMouseCursor {
z-index:10000000!important;
position: fixed;
width: 35px;
height: 35px;
border: 1px solid #fff;
background: rgba(0,0,0,0.2);
border-radius: 50%;
z-index: 9999;
left: 0;
top: 0;
transition: transform 0.07s, width 0.3s, height 0.3s;
pointer-events: none; }
body #magicMouseCursor.cursor-square {
border-radius: 0; }
body #magicPointer {
z-index:10000000!important;
height: 5px;
width: 5px;
top: 0;
left: 0;
position: fixed;
background: red;
border-radius: 50%;
pointer-events: none;
transition: background 0.2s, width 0.2s, height 0.2s, box-shadow 0.2s; }
body #magicPointer.is-hover {
background: #fff; }
body #magicPointer.pointer-blur {
height: 50px;
width: 50px;
background: none;
border: 1px solid #fff;
box-shadow: 0px 0px 15px -5px white; }
body #magicPointer.pointer-overlay {
height: 50px;
width: 50px;
mix-blend-mode: difference;
box-shadow: 0px 0px 15px -5px white; }
body .magic-hover {
transition: all 0.2s; }
body .magic-hover:hover {
cursor: none!important; }
}
Magic Classes For The Snappy Touch
In Wp > Appearance > Menus, make sure you enable the class attribute by clicking on screen options in the top right of the window, and ticking the option “Css Classes“.
Then, open the toggle of any menu item, and in the field labeled “CSS Classes (optional)“, paste the following classes:
magic-hover magic-hover__square
Your turn!
So, I hope you got value out of this tutorial as you will now be able to add a little trendy touch to your website, for that premium feel.
If you watched the companion video and if you like it, please give it a thumbs up, as it really helps growing the Youtube channel – It does really help, and it doesn’t cost you a thing!.
Oh, if you want to know how to create a beautiful branding for yourself, your business or for your clients, you can download (totally free) my branding guidelines template by clicking here.
So, that’s it for this tutorial, I hope to see you around here or on the Youtube channel, and in the meantime, don’t forget to invest in YOUR success!