Site logo

[Resolved] Nav bar hover animation edit?

Home Forums Support [Resolved] Nav bar hover animation edit?

Home Forums Support Nav bar hover animation edit?

  • This topic has 5 replies, 2 voices, and was last updated 5 years ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1755097
    chris

    Im trying to change the Navigation hover effect, and the CSS im trying to use from cssdeck as following doesnt seem to want to work, not sure what im missing.. if others wish to add different navigation hover this could be useful thread

    .main-navigation ul li a:hover {
    color: #91640F;
    }
    .main-navigation ul li a:after {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    margin: auto;
    width: 100%;
    height: 1px;
    content: ‘.’;
    color: transparent;
    background: #F1C40F;
    visibility: none;
    opacity: 0;
    z-index: -1;
    }
    .main-navigation ul li a:hover:after {
    opacity: 1;
    visibility: visible;
    height: 100%;
    }

    /* Keyframes */
    @-webkit-keyframes fill {
    0% {
    width: 0%;
    height: 1px;
    }
    50% {
    width: 100%;
    height: 1px;
    }
    100% {
    width: 100%;
    height: 100%;
    background: #333;
    }
    }

    #1755926
    David
    Staff
    Customer Support

    Hi there,

    first off you would need to set the Customizer > Colors > Primary Navigation background to transparent.

    Then try this CSS:

    .main-navigation .main-nav ul li a:after {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        margin: auto;
        width: 100%;
        max-height: 1px;
        height: 100%;
        content: '.';
        color: transparent;
        background: #F1C40F;
        visibility: none;
        opacity: 0;
        z-index: -1;
        transition: all 0.3s ease-in;
    }
    
    .main-navigation .main-nav ul li:hover a:after {
        opacity: 1;
        visibility: visible;
        max-height: 100%;
    }
    #1765410
    chris

    That works to animate when mouse leaving the nav bar, any way to make it do the same when entering hover?

    Sorry to be a pain, understandable if this isnt theme support area.

    #1765924
    David
    Staff
    Customer Support

    I am still seeing a background hover color applied in Customizer > Colors > Primary Navigation – that needs to set to transparent for the effect to be seen.

    #1766398
    chris

    Duh silly me, sorry.. Thank you!

    #1766425
    David
    Staff
    Customer Support

    Glad to be of help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.