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;
}
--
Posted via http://www.ruby-forum.com/.
set the property display: hidden; I also dont think you need the return false in there , but i could be wrong. adam On 11/21/05, Nick Ce <graphis1-ee4meeAH724@public.gmane.org> wrote:> 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; > } > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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? -- Posted via http://www.ruby-forum.com/.
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
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> > > <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 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
> The trick is to put the "display: none" in the style attribute of the > tag, and NOT in the CSS class for the div. > > - JamisRock 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. -- Posted via http://www.ruby-forum.com/.