Why isn't my custom cursor changing on link hover?

Solved

Why isn't my custom cursor changing on link hover?

Toptoys2uHS
Explorer
87 1 9

Hello All,

 

I am trying to add two different custom cursors to this website, both of which will be an image file.

 

Unfortunately, when adding my code in, with two different images and what I assume is two different cursor states (one for default and one for links), the cursor does not change when hovering over links, and just continues with the same cursor.

 

Please see the code below:

<style>
      html {
        pointer-events::none :url({{'https://cdn.shopify.com/s/files/1/1779/2423/files/Halloween_Broomstick.png?v=1696249673'}}), auto;
      }
      html *{
        cursor: url({{'https://cdn.shopify.com/s/files/1/1779/2423/files/Christmas_Candy_Cane_Cursor.png?v=1697028426'}}), auto !important;
      }
</style>

Would anyone know how to update the code so that two different cursors will be displayed, one for default and one for hovering links?

 

Please see the website below.

 

https://toptoys2u.co.uk/

 

I highly appreciate any help!

Accepted Solution (1)
Mike-Consentik
Shopify Partner
172 28 36

This is an accepted solution.

Hi @Toptoys2uHS 

Try this: 

<style>
html * {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Halloween_Broomstick.png?v=1696249673'), auto;
}
html a {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Christmas_Candy_Cane_Cursor.png?v=1697028426'), auto !important;
}
</style>
If you find this helpful, please give it a like or mark it as a solution.
Consentik GDPR Cookie Banner: Effortlessly stay in compliance with EU GDPR and CCPA with Google Consent Mode V2. Free plan available and 24/7 Support

View solution in original post

Replies 7 (7)

Mike-Consentik
Shopify Partner
172 28 36

Hi @Toptoys2uHS 

This is Mike from Omega

If you want to custom broomstick for default and Candy cane for link, you can try my CSS code

html * {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Halloween_Broomstick.png?v=1696249673'), auto;
}
html a {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Christmas_Candy_Cane_Cursor.png?v=1697028426'), auto;
}

Hope my answer will help you

Mike from Omega

If you find this helpful, please give it a like or mark it as a solution.
Consentik GDPR Cookie Banner: Effortlessly stay in compliance with EU GDPR and CCPA with Google Consent Mode V2. Free plan available and 24/7 Support
Toptoys2uHS
Explorer
87 1 9

Hi @Mike-Consentik 

 

Unfortunately, this code only seems to make the broomstick (default) work, while the links change back to a regular "hand" default cursor.

 

I added this into theme.liquid like so:

 

<style>
html * {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Halloween_Broomstick.png?v=1696249673'), auto;
}
html a {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Christmas_Candy_Cane_Cursor.png?v=1697028426'), auto;
}
</style>

 

Would this be better suited in a different asset?

Mike-Consentik
Shopify Partner
172 28 36

This is an accepted solution.

Hi @Toptoys2uHS 

Try this: 

<style>
html * {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Halloween_Broomstick.png?v=1696249673'), auto;
}
html a {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Christmas_Candy_Cane_Cursor.png?v=1697028426'), auto !important;
}
</style>
If you find this helpful, please give it a like or mark it as a solution.
Consentik GDPR Cookie Banner: Effortlessly stay in compliance with EU GDPR and CCPA with Google Consent Mode V2. Free plan available and 24/7 Support
Toptoys2uHS
Explorer
87 1 9

Hi @Mike-Consentik 

 

This seems to work, thank you very much for your help!

 

This seems to work, and I can use it for specific areas of the site with some (if) statement code too!

 

Accepted as a solution and like given! 

Thank you once again.

For anyone looking for this solution, the code is below - you only need to change the URLs to your own images - paste into Theme.Liquid

<style>
html * {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Halloween_Broomstick.png?v=1696249673'), auto;
}
html a {
cursor: url('https://cdn.shopify.com/s/files/1/1779/2423/files/Christmas_Candy_Cane_Cursor.png?v=1697028426'), auto !important;
}
</style>
Emiway
Pathfinder
165 0 36

Where To Paste This Code In Theme.Liquid

Emiway
Pathfinder
165 0 36

Where To PAste It????

Mike-Consentik
Shopify Partner
172 28 36

@Emiway  you can paste it before the closing head tag </head> on theme.liquid

If you find this helpful, please give it a like or mark it as a solution.
Consentik GDPR Cookie Banner: Effortlessly stay in compliance with EU GDPR and CCPA with Google Consent Mode V2. Free plan available and 24/7 Support