Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

296
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda