Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

298
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!