Buttons with animated icons on hover

Hi there,

Do we have any ways to create animated buttons. I tried to use the exiting buttons in pro using primary and secondary graphic option but there is no way to hide the graphic and only show on hover. Below is an example:

Any help would be appreciated.

Amit

Hello Amit,

Please try this:
1.) Add button element. Define the width.

2.) Set GRAPHIC to ON. Choose the icon.
3.) Add the following CSS on Customize tab > Element CSS

$el:hover i {
    left: 15px;
    opacity: 1;
}
$el:hover .x-anchor-text {
    margin-left:-10px;
      -webkit-transition: all .3s;
    -o-transition: all .3s;
    transition: all .3s;
  
}
$el i {
    -webkit-transition: all .3s;
    -o-transition: all .3s;
    transition: all .3s;
    position: absolute;
    top: 50%;
    left: 0px;
    transform: translateY(-50%);
    opacity: 0;
}

Feel free to adjust values accordingly.
4.) Adjust other button settings as needed.
See this: https://screencast-o-matic.com/watch/cqioImOYNq

Hope this helps.

1 Like

Thanks! works like a charm :slight_smile:

Glad we could help.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.