Jump to content

- Adding animation to individual folder categories

Recommended Posts

Posted (edited)

Hi,

I'm trying to add animation to the individual categories of a menu folder.

I tried the code below and it works, but only on the entire folder.. Is it possible to animate/delay the different submenues individually?

 

 

.header-nav-item.header-nav-item--folder:hover .header-nav-folder-content {
    animation: translateX 300ms ease-in-out forwards;
  
  
}

@keyframes translateX {
  0% {
    opacity: 0;
    transform: translateX(60px);
  }
  
  80% {
    transform: translateX(-5px);
  }

  100% {
    opacity: 1;
    transform: translateX(0px);
  }
}

 

This is the original code i found:

.dropdown_menu-5
  for num in (1..5)
     .dropdown_item-{num}  
       transform-origin: top center
       animation: translateX 300ms (num * 60ms) ease-in-out forwards


@keyframes translateX {
  0% {
    opacity: 0;
    transform: translateX(60px);
  }
  
  80% {
    transform: translateX(-5px);
  }

  100% {
    opacity: 1;
    transform: translateX(0px);
  }
}

 

Edited by sckunckel
  • Replies 3
  • Views 536
  • Created
  • Last Reply

Top Posters In This Topic

Posted
On 11/1/2022 at 8:33 PM, sckunckel said:

Hope this is correct 🤞

https://nectarine-goby-fgp2.squarespace.com/

Pass: BM123test!

Try adding this code under

div.header-nav-folder-item:hover {
    animation: translateX 300ms ease-in-out forwards;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.