Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
keyframes animation of cursor doesnt work in Safari

I have a gif that I converted into an images. After the user clicks on the screen, the cursor is animated with keyframes. It works perfectly in every browser except Safari. I tried almost everything, what am I doing wrong?

CSS

@keyframes cursor {
  0% {
    cursor: url("./images/frames/1.gif"), auto;
  }
  20% {
    cursor: url("./images/frames/2.gif"), auto;
  }
  40% {
    cursor: url("./images/frames/3.gif"), auto;
  }
  60% {
    cursor: url("./images/frames/4.gif"), auto;
  }
  80% {
    cursor: url("./images/frames/5.gif"), auto;
  }
  100% {
    cursor: url("./images/frames/6.gif"), auto;
  }
}

@-webkit-keyframes cursor {
  0% {
    cursor: url("./images/frames/1.gif"), auto;
  }
  20% {
    cursor: url("./images/frames/2.gif"), auto;
  }
  40% {
    cursor: url("./images/frames/3.gif"), auto;
  }
  60% {
    cursor: url("./images/frames/4.gif"), auto;
  }
  80% {
    cursor: url("./images/frames/5.gif"), auto;
  }
  100% {
    cursor: url("./images/frames/6.gif"), auto;
  }
}



JS

const productPage = document.querySelector('.product-page')

      if (!this.state.done) {

        productPage.style.animation = "cursor 0.2s linear"
        productPage.style.webkitAnimation = "cursor 0.2s linear"

        setTimeout(() => {
          productPage.style.animation = "none"
        }, 210);
        
      }

I even tried to use pure JS instead of keyframes

const productPage = document.querySelector('.product-page')

      if (!this.state.done) {

        let gifNumber = 1

        const cursorInterval = setInterval(() => {

          discountPage.style.cursor = `url("./images/frames/${gifNumber}.gif") 37 37, auto`

          gifNumber++

          if (gifNumber > 5) {
            clearInterval(cursorInterval)
          }

        }, 1);

      }
 

this one also worked in other browsers but not in Safari. I guess it's not possible to dynamically change the cursor in Safari

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda