[thelist] Any script.aculo.us users out there?

sam foster potatosculptor at gmail.com
Mon Mar 27 15:22:28 CST 2006

Old thread but my 2c...

> One - I think your onclick syntax is wrong. You don't need to use
> document.getElementById - just the name of the id.

Actually either will work. It is using Prototype.js's $() function,
which will use document.getElementById if its given a string, or take
the argument as an element reference. Handy, and becoming widely
adopted shorthand.

As for the other problem. I think this is also rooted in Prototype. It
provides Element.show and Element.hide functions, which basically
toggle the display property between 'block' and 'none'. And it is
looking in the style property (last time I checked), so unless you
have set the display property via script, or set it as an inline
style, the first time it goes to toggle, it will hide, rather than
show the element ??? (lots of guesswork here, sorry its been a while
since i used this library)

Anyhow, hiding via javascript first will (should) fix it.

> Of course, making it hidden via JS is probably better, but I don't
> know how to do that so...



More information about the thelist mailing list