Forum: Ruby on Rails BlindDown Effect - starting with hidden div

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6b7c871c2036a41f0253580074b406cc?d=identicon&s=25 Nick C. (n1c)
on 2005-11-21 23:33
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:
<a href='#' onclick="Effect.BlindDown('addcompany');return false;">add
company</a>

and the div css is:

#addcompany {
	position:absolute;
	background-color: #3f3;
	overflow:hidden;
	top: 180px;
	left: 280px;
	height: 100px;
        width: 200px;
	}
F15fdc7cb2e911b3808837f2be244add?d=identicon&s=25 straightflush (Guest)
on 2005-11-21 23:51
(Received via mailing list)
set the property display: hidden;

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

adam
6b7c871c2036a41f0253580074b406cc?d=identicon&s=25 Nick C. (n1c)
on 2005-11-22 00:01
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?
C618e1d9ffa1bd1a6b6edc8ad4edec63?d=identicon&s=25 mannl (Guest)
on 2005-11-22 00:07
(Received via mailing list)
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.


<div id="mydiv" style="display:none;">
<div style="height:50px;">
<h1>Quack!</h1>
</div>
</div>

<%= 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
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 jamis (Guest)
on 2005-11-22 00:07
(Received via mailing list)
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
6b7c871c2036a41f0253580074b406cc?d=identicon&s=25 Nick C. (n1c)
on 2005-11-22 00:15
> 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.
This topic is locked and can not be replied to.