Jump to content

Excluding Accordion from Fade In Effect (Custom CSS)

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Looking for help troubleshooting this "Fade In" code I used on a client's website (CSS copied below).

It's doing what it's supposed to on the homepage (see here), but I found it also makes the accordion headers fade in and out. Does anyone know how to exclude accordions from custom CSS?

Thank you for any help!

/*FadeIn*/
.fadeIn span{
    animation: fadeEffect 10.5s linear infinite 0s;
    -ms-animation: fadeEffect 10.5s linear infinite 0s;
    -webkit-animation: fadeEffect 10.5s linear infinite 0s;
    color: #ffffff;
    opacity: 0;
    overflow: hidden;
    position: absolute;
}
.fadeIn span:nth-child(2){
    color: #ffffff;
    animation-delay: 2.5s;
    -ms-animation-delay: 2.5s;
    -webkit-animation-delay: 2.5s;

.fadeIn span:nth-child(3){
    color: #ffffff;
    animation-delay: 5s;
    -ms-animation-delay: 5s;
    -webkit-animation-delay: 5s;

}
.fadeIn span:nth-child(4){
    color: #ffffff;
    animation-delay: 7.5s;
    -ms-animation-delay: 7.5s;
    -webkit-animation-delay: 7.5s;
}

/*FadeIn Animation*/
@-moz-keyframes fadeEffect{
    0% { opacity: 0; }
    5% { opacity: 0; -moz-transform: translateY(0px); }
    10% { opacity: 1; -moz-transform: translateY(0px); }
    25% { opacity: 1; -moz-transform: translateY(0px); }
    30% { opacity: 0; -moz-transform: translateY(0px); }
    80% { opacity: 0; }
    100% { opacity: 0; }
}
@-webkit-keyframes fadeEffect{
    0% { opacity: 0; }
    5% { opacity: 0; -webkit-transform: translateY(0px); }
    10% { opacity: 1; -webkit-transform: translateY(0px); }
    25% { opacity: 1; -webkit-transform: translateY(0px); }
    30% { opacity: 0; -webkit-transform: translateY(0px); }
    80% { opacity: 0; }
    100% { opacity: 0; }
}
@-ms-keyframes fadeEffect{
    0% { opacity: 0; }
    5% { opacity: 0; -ms-transform: translateY(0px); }
    10% { opacity: 1; -ms-transform: translateY(0px); }
    25% { opacity: 1; -ms-transform: translateY(0px); }
    30% { opacity: 0; -ms-transform: translateY(0px); }
    80% { opacity: 0; }
    100% { opacity: 0; }
}

  • Replies 3
  • Views 1.6k
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
  • Solution
Posted

Add this CSS code

span.accordion-item__title {
    animation: unset !important;
    -ms-animation: unset !important;
    -webkit-animtaion: unset !important;
    position: static !important;
    opacity: 1 !important;
    color: initial !important;
}

 

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.