Jump to content

tan-flatworm

Member
  • Posts

    8
  • Joined

  • Last visited

tan-flatworm's Achievements

Level 1

Level 1 (1/20)

2

Reputation

  1. Thank you @tuanphan. This code didn't work for me either but I figured out a way around (for anyone who is interested) : I added an Id to my html code and changed the css code accordingly. I used the following code for js: <script> let btn = document.getElementById("btn"); btn.onmousemove = function (e) { let rect = e.target.getBoundingClientRect(); let x = e.clientX - rect.left; let y = e.clientY - rect.top; btn.style.setProperty("--x", x + "px") btn.style.setProperty("--y", y + "px"); }; </script>
  2. Thank you very much! Unfortunately the first one is not responsive and the second one totally messes up the page. Is there a way around it?
  3. Hello @tuanphan can you please help me add the following codepens as well? 1)https://codepen.io/electerious/pen/MQrRxX I tried it on a drop-down-button on my page but failed totally... 2)https://codepen.io/amit_sheen/pen/af022e80f75789c6b80a8d0eb718f890 Thank you!
×
×
  • 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.