BlindDown Effect - starting with hidden div

I would like to reveal a hidden div when the user clicks a link, using
the Effect.BlindDown scriptaculous method.

How do I arrange it so that the div starts off hidden, but reveals
itself with a BlindDown when the user clicks a link?

Currently the link is:
add
company

and the div css is:

#addcompany {
position:absolute;
background-color: #3f3;
overflow:hidden;
top: 180px;
left: 280px;
height: 100px;
width: 200px;
}

set the property display: hidden;

I also dont think you need the return false in there , but i could be
wrong.

adam

Many thanks for the reply, Adam.

I’ve tried with display:hidden, display:none and visibility:hidden;

display:hidden; makes no difference.
display:none; and visibility:hidden; both hide the div to begin with,
but it is not revealed when the DropDown function is called - it stays
hidden.

Any ideas?

It’s display:none
(There’s no display:hidden - only visibility:hidden)

Also someone correct me if I’m wrong but I think blind-down and blind-
up both need an additional inner div with a fixed height.

Quack!

<%= link_to ‘Mooh?’, ‘#’, :onclick => visual_effect
(:blind_down, :mydiv) %>

So sweet… Too bad Rails isn’t a girl… Meh… The real one’s are good
at blinding up though

Rob

On Nov 21, 2005, at 4:03 PM, Robert wrote:

It’s display:none
(There’s no display:hidden - only visibility:hidden)

Also someone correct me if I’m wrong but I think blind-down and
blind-up both need an additional inner div with a fixed height.

The additional inner div is unnecessary, although there may be some
cases that need it (not sure).

The trick is to put the “display: none” in the style attribute of the
tag, and NOT in the CSS class for the div.

  • Jamis

The trick is to put the “display: none” in the style attribute of the
tag, and NOT in the CSS class for the div.

  • Jamis

Rock and roll! Works nicely now, thanks Jamis.

Many thanks indeed to everyone for their help. I think I’ll amend the
scritpaculous wiki to include this hint and stop future sorry souls
going nuts over it.