<p>The scriptaculous wiki has a demo (<a href="http://github.com/madrobby/scriptaculous/wikis/effect-slidedown" rel="nofollow noreferrer">http://github.com/madrobby/scriptaculous/wikis/effect-slidedown</a>) that shows the SlideDown effect in use. However I need to have the same link to slide down if a certain DIV is hidden and SlideUp if that DIV is showing.</p>

<p>How do I achieve this?</p>

<p>Thanks.</p>

Wrap it in a function, call the function instead.
```
```
function slideMe(myDiv) {

    if(Element.visible(myDiv)) {
    //slide up

    }

    else {

    //slide down

    }
}
```
```