Alfred
Alfred

Reputation: 21406

div disappearing on margin & width animaton problem - jquery

I have coded my div to re size and change margin on click of a div with id = switch. But it is disappearing on beginning of animation and reappear on the completion of animation. Ypu can see my fiddle here. Why is this happening and how can I avoid this??

Thanks in advance...:)

blasteralfred

Upvotes: 0

Views: 124

Answers (3)

Dr.Molle
Dr.Molle

Reputation: 117334

During the animation the elements overflow is set to "hidden". As #switch is visually placed outside #sidebar it disappears. Christopher's solution should override it. It also would'nt happen if you place #switch inside #viewer

Upvotes: 0

James Khoury
James Khoury

Reputation: 22319

It is happening because it is hidden underneath your "viewer". If you can move your switch inside the "viewer" and float it left, set margin-left. Should fix it.

Upvotes: 0

Christopher Manning
Christopher Manning

Reputation: 4557

Add

 overflow: visible !important;

to #sidebar and#switch won't disappear during the animation.

Upvotes: 2

Related Questions