Jumping input fields in Safari

后端 未结 3 771
被撕碎了的回忆
被撕碎了的回忆 2021-01-31 21:38

I\'m trying to recreate a pretty cool placeholder UI using only HTML and CSS, and I\'ve almost got it (demo). However, if you type something in an input field and tab to focus o

3条回答
  •  长发绾君心
    2021-01-31 22:22

    It seems that the placeholder-attribute cannot be animated. So I made a little fake-placeholder and animated this. Unfortunately, if you only use CSS, the animation will go off, if you leave the input. So I added a little bit of JS-magic to trigger the animation.

提交回复
热议问题