An Interest In:
Web News this Week
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
- March 26, 2024
July 10, 2021 04:56 pm GMT
Original Link: https://dev.to/hosseinmobarakian/create-a-custom-cursor-for-your-website-4lpb
Create a custom cursor for your website
Hi, Do you think about how you can create a custom cursor for your website?
This section will show you how to create custom cursors quickly and easily. We must take simple step (Create a HTML file and paste the codes below into it)
<div class="mouse" id="mouse"> <img src="https://i.postimg.cc/NFx1b2f7/pack2586.png" alt=""> </div> <style> body, html { width: 100%; height: 100%; overflow: hidden; } * { cursor: none; } .mouse { width: 20px; height: 20px; background-color: none; position: absolute; top: 0; left: 0; z-index: 1000; } .mouse img { width: 40px; } </style> <script> document.onmousemove = function (e) { var mouse = document.getElementById("mouse"); console.log(mouse.style); mouse.style.left = e.pageX + 1 + "px"; mouse.style.top = e.pageY + 1 + "px"; } </script>
Original Link: https://dev.to/hosseinmobarakian/create-a-custom-cursor-for-your-website-4lpb
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To