Yevgeny Simkin
Yevgeny Simkin

Reputation: 28359

How do I pre-hide something in preparation to expose it in a jQuery animation?

I have a button div that I've attached a jQuery animation to, that exposes/hides it upon some other event.

It works nicely, but I'm unclear on what style elements of the div they are altering, so, I'm not sure how to set up its CSS so that it starts out hidden and then becomes exposed when the event that starts the animation is kicked off.

Upvotes: 2

Views: 906

Answers (3)

Hank
Hank

Reputation: 731

use display: none; thats what jquery sets it to once it has been 'hidden'

Upvotes: 1

Connor
Connor

Reputation: 1034

You've got a couple options:

With css

display: none;

Or jQuery

.hide()

Upvotes: 2

Ashley Strout
Ashley Strout

Reputation: 6258

As I understand it, you are wondering what properties to put on in the base page code. In that case, just put a simple display:none; on the button element - jQuery is smart enough to take care of the rest.

Upvotes: 3

Related Questions