Randomblue
Randomblue

Reputation: 116263

`.show()` inconsistent behaviour (bug?)

I have a hidden element $myHiddenElement. Now if I do

$myHiddenElement.show();

all is OK. However, if I do

$myHiddenElement.show(300);

then $myHiddenElement gets the attribute display: block; which damages my layout.

Upvotes: 1

Views: 93

Answers (2)

m90
m90

Reputation: 11812

There seems to be a jQuery-bug (in older versions) that could be causing this. See: http://jsfiddle.net/Ux8xL/1/ working with 1.6.2 whereas when you go back to 1.2.6 ( http://jsfiddle.net/Ux8xL/2/) it's not taking into account the inline-display rule from the CSS.

EDIT: I am assuming your hidden element is a block element that is set to inline-behavior. In case not: ?

Upvotes: 2

Marco Johannesen
Marco Johannesen

Reputation: 13134

It uses display:block; to create the animation, thats why it only comes when you put a timer on it.

Basicly you should just be able to float:left and display:block on the element - which would produce the same as display:inline-block or whatever you are using now.

Upvotes: 1

Related Questions