
I've created an @keyframes animation that changes the cursor with custom images, and assigned it to div on hover.
When hovering on the div for the first time after the page is loaded, the cursor either flicker or disappear for a second, and then works normally as intended.
Why does this occur, and how can it be fixed?
div {
background-color: #71c174;
display: inline-block;
margin: 0;
padding: 10px;
font-size: 30px;
}
div:hover {
cursor: url(https://perseverancex.sirv.com/images/frame-24.png), auto;
animation-name: cursor;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
@keyframes cursor {
0% {
cursor: url(https://perseverancex.sirv.com/images/frame-1.png), auto;
}
4% {
cursor: url(https://perseverancex.sirv.com/images/frame-2.png), auto;
}
8% {
cursor: url(https://perseverancex.sirv.com/images/frame-3.png), auto;
}
12% {
cursor: url(https://perseverancex.sirv.com/images/frame-4.png), auto;
}
16% {
cursor: url(https://perseverancex.sirv.com/images/frame-5.png), auto;
}
20% {
cursor: url(https://perseverancex.sirv.com/images/frame-6.png), auto;
}
24% {
cursor: url(https://perseverancex.sirv.com/images/frame-7.png), auto;
}
28% {
cursor: url(https://perseverancex.sirv.com/images/frame-8.png), auto;
}
32% {
cursor: url(https://perseverancex.sirv.com/images/frame-9.png), auto;
}
36% {
cursor: url(https://perseverancex.sirv.com/images/frame-10.png), auto;
}
40% {
cursor: url(https://perseverancex.sirv.com/images/frame-11.png), auto;
}
44% {
cursor: url(https://perseverancex.sirv.com/images/frame-12.png), auto;
}
48% {
cursor: url(https://perseverancex.sirv.com/images/frame-13.png), auto;
}
52% {
cursor: url(https://perseverancex.sirv.com/images/frame-14.png), auto;
}
56% {
cursor: url(https://perseverancex.sirv.com/images/frame-15.png), auto;
}
60% {
cursor: url(https://perseverancex.sirv.com/images/frame-16.png), auto;
}
64% {
cursor: url(https://perseverancex.sirv.com/images/frame-17.png), auto;
}
68% {
cursor: url(https://perseverancex.sirv.com/images/frame-18.png), auto;
}
72% {
cursor: url(https://perseverancex.sirv.com/images/frame-19.png), auto;
}
76% {
cursor: url(https://perseverancex.sirv.com/images/frame-20.png), auto;
}
80% {
cursor: url(https://perseverancex.sirv.com/images/frame-21.png), auto;
}
84% {
cursor: url(https://perseverancex.sirv.com/images/frame-22.png), auto;
}
88% {
cursor: url(https://perseverancex.sirv.com/images/frame-23.png), auto;
}
100% {
cursor: url(https://perseverancex.sirv.com/images/frame-24.png), auto;
}
}
<body>
<div>Hover Box</div>
</body>