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

297
Visualizações
Gif animation hover Javascript

Trying to make an animation for my header logo in Squarespace. I'm using two gifs and a static image to make the animation. I'm almost getting it to work but it doesn't start right away when I hover on and off of the logo.

This is the script

<!--- Header logo animation --->
<script>
  
  $(function() {
    $(".header-title-logo").hover(
        function() {
            /* starting animation */
            var url = "url('https://static1.squarespace.com/static/5eb2a533deb05f200fce94ac/t/6242d5db8776ee2a68aefa31/1648547293662/one_loop.gif?time=" + new Date().getTime() + "')";
            $(this).css("background-image", url);
        },
        function() {
            /* ending animation */
            var url = "url('https://static1.squarespace.com/static/5eb2a533deb05f200fce94ac/t/6242d5cf5418df43b4c9e360/1648547281712/reverse.gif?time=" + new Date().getTime() + "')";
console.log(url);
            $(this).css("background-image", url );
        }                         
    );                  
});
</script>

This is the css

//\* Header Title & Logo animation \*/
.header-title-logo{
  background-image: url('https://static1.squarespace.com/static/5eb2a533deb05f200fce94ac/t/623dd1041339ae4479fe9715/1648218372746/ablogos2.png');
  background-size: cover;
  background-repeat:no-repeat;
  cursor:pointer;
}
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