Skip to content
Advertisement

An element is jumping up when i run a JS that includes him

I’m working on a login form now, and I’m facing a problem. In the password input field, i have a “toggle eye” what toggle visibility for the password. I wrote the script and all is working fine, but when i click on that eye, it jumps up for 2-3 millimeters for an unknown reason.

Here you can try that code. Thanks!

JavaScript
JavaScript

Advertisement

Answer

In my opinion this is because of the transition between i#show and i#hide
One way to avoid this is for example omitting one i tag like this

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement