Question: I need to display a div from `display:none` to `display:block` giving it a `fade effect`. How can I do this in prototypejs? Thanks.

```
<div id="fadeId" style="display:none">
</div>

```

Answer: 
i see that i am late to the party here, but you can do it with a custom function and a timer.

```
function animate() {
  var element = $('fadeId');
  var opacity = element.getOpacity() + 0.1;
  element.setStyle({'display': 'block', 'opacity': opacity});
  if(opacity < 1) {
    setTimeout(animate, 100);
  }
}
function doshow() {
  var element = $('fadeId');
  element.setStyle({'display': 'block', 'opacity': 0.0});
  setTimeout(animate, 100);
}
$('show').on('click', doshow);

```

see the fiddle at <http://jsfiddle.net/ApzhJ/>

to fade in and fade out, check out fiddle <http://jsfiddle.net/Y5CB9/>
You can use Jquery for this 

```
$("#fadeId").fadeIn(slow);

```