# How can hide a div?

**URL:** <https://www.ruby-forum.com/t/how-can-hide-a-div/133953>\
**Category:** Rails\
**Created:** [April 5, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/how-can-hide-a-div/133953 "2008-04-05T14:51:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 5, 2008, 2:51pm UTC](https://www.ruby-forum.com/t/how-can-hide-a-div/133953/1 "2008-04-05T14:51:40Z")

</div>

I have a form wich I want to show it only if I clic on a link. I want  
that form, with div=“related”, to appear with the Appear effect of  
scriptaculous. This form alreday has some AJAX.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 5, 2008, 2:54pm UTC](https://www.ruby-forum.com/t/how-can-hide-a-div/133953/2 "2008-04-05T14:54:44Z")

</div>

On Apr 5, 1:51 pm, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I have a form wich I want to show it only if I clic on a link. I want  
> that form, with div=“related”, to appear with the Appear effect of  
> scriptaculous. This form alreday has some AJAX.

Something along the lines of link\_to\_function ‘ClickMe’, “$  
(‘some\_id’).appear()” will make the page element with that id appear.

Fred

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 5, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/how-can-hide-a-div/133953/3 "2008-04-05T18:57:14Z")

</div>

Frederick C. wrote:

> On Apr 5, 1:51ï¿½pm, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > I have a form wich I want to show it only if I clic on a link. I want  
> > that form, with div=“related”, to appear with the Appear effect of  
> > scriptaculous. This form alreday has some AJAX.
> 
> Something along the lines of link\_to\_function ‘ClickMe’, “$  
> (‘some\_id’).appear()” will make the page element with that id appear.
> 
> Fred

My code is:

 ![my_image](https://www.ruby-forum.com/images/Logo_small.jpg)

\<%= link\_to\_function “Appear”,  
“new Effect.Appear(‘fadePic’, { duration:2 })” %\>

I want the fadepic only to appear in my view once I press the Appear  
link.

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [April 5, 2008, 7:10pm UTC](https://www.ruby-forum.com/t/how-can-hide-a-div/133953/4 "2008-04-05T19:10:24Z")

</div>

On 5 Apr 2008, at 17:57, John S. wrote:

> > (‘some\_id’).appear()" will make the page element with that id appear.  
> > “new Effect.Appear(‘fadePic’, { duration:2 })” %\>

Style it so that it is initially invisible. (display: none)

Fred
