Jump to content

How to hide custom cursor on iframe?

Recommended Posts

Hello. I've been trying to hide my custom cursor when hovering over embedded video from Vimeo.
Found this code on the web and tried to Code Inject but it doesn't work in my case.

<script> 
let iframe = document.querySelector("iframe");
let videoWrapper = document.querySelector(".project-component_extra-embed");
let mouseCursor = document.querySelector(".cursor"); 


iframe.addEventListener("mouseover", function() {
  mouseCursor.style.display = 'none';
});

iframe.addEventListener("mouseleave", function() {
  mouseCursor.style.display = 'flex';
});
  
videoWrapper.addEventListener("mouseover", function() {
  mouseCursor.style.display = 'none';
});

videoWrapper.addEventListener("mouseleave", function() {
  mouseCursor.style.display = 'flex';
});
</script>



My website: https://evolsound.squarespace.com/work
Pass: LightboxAnything
(The issue can be seen on any of the projects)

Does anyone know how this can be done?

Edited by ufotofu
Link to comment
  • Replies 1
  • Views 319
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.