Randomblue
Randomblue

Reputation: 116263

jQuery .show() makes input box shiver

My code:

$('input').hide().show(10000);

I have tested the jsFiddle with Google Chrome 14 on Windows 7 and Mac OS 10.7.

The input box shivers towards the end of the animation. Is this a bug or the expected effect?

Upvotes: 5

Views: 207

Answers (2)

Lapple
Lapple

Reputation: 3373

It is not a bug I think. The truth is that the browser is usually unable to set non-integer width or height of an input element, trying to round, for example, height: 11.007252845381956px to height: 11px or 12px.

The shivering disappears once you set vertical-align as follows (fiddle):

input {
    vertical-align: top;
}

Therefore I can assume that the vibration comes from browser's inability to determine (or round) height, line-height or any other property that influences the vertical alignment.

Upvotes: 4

genesis
genesis

Reputation: 50966

This is probably browser's bug. It "vibrates" with 1000 duration too so I assume it's browser-related bug

http://jsfiddle.net/pzP4Q/1/

Upvotes: 1

Related Questions