Start a slide closed

Hi,
I try to start a site with a closed Fx.Slide(). What I have:

$$('div.cont_inside').each(function(el) {
		
					el.set('slide', {
					
						mode: 'vertical',
						duration: 'short'
						}).hide();

				});
<a href="#" onClick="$$('.cont_inside')[0].slide('toggle'); return false;">navi 1</a>

The slide starts closed but don´t comes up on click. Without the ‘.hide()’ it works normal. Only want to
start the slide in closed condition.

Thanx for help

w/regards
Michael

In your code, you have two ‘$’ in the onClick. Is that copied/pasted from your actual code? If so, take out one of the ‘$’.

Hi,

thanx for your answer. I don´t know what you exactly mean. $$ returns a collection and I take the first [0] of them. Without it comes to

TypeError: $(…) is null

I just want to know how to hide an element on startup. The first toggle should be the reveal of the element… not the dissolve.

w/regards
Michael

… the solution is:

$$('div.cont_inside').each(function(el) {
		
					el.set('slide', { 
					
						mode: 'vertical',
						duration: 'short'
						}).slide ('hide');

				});

Sorry if I missed something, but isn’t this identical to post one.

In the Prototype library, the double dollar selector takes an arbitrary number of CSS selectors (strings) and returns a document-order array of extended DOM elements that match any of them.
I’m guessing that’s what the OP is using.

Nope. There are still two dollars but ‘slide (‘hide’)’ instead of hide ().

Ah. Missed that. Cheers :slight_smile: