Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search box animation

I created a search box animation. when click on the icon, it opens. The problem is when I click on the "x" to close the box, it moves to right end first and then close. This is the link:enter code herehttps://codepen.io/BeauBo/pen/YxNwpp . Anybody can help me with this? Thanks in advance!

like image 746
Bo Huang Avatar asked Mar 06 '26 10:03

Bo Huang


2 Answers

It interferes with another class from "close.less" (I couldn't figure out where this css comes from). If you just rename your "close" class to something like "close-form", it should work fine.

like image 131
Chrisstar Avatar answered Mar 08 '26 22:03

Chrisstar


The reason your search bar is being moved to the right is because your form is getting float: right; when the close button is pressed.

Add the following to your form.close class in your css to fix this issue.

form.close,
form.close .bar,
form.close .bar:before,
form.close .bar:after {
    float: none;
    animation-direction: reverse;
}
like image 24
afterburn Avatar answered Mar 08 '26 22:03

afterburn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!