Effect.SlideDown() element.down() has no properties

0 views
Skip to first unread message

JustinK101

unread,
May 11, 2008, 1:16:15 AM5/11/08
to Ruby on Rails: Spinoffs
I don't know what's going on here, I am getting a js error:
element.down() has no properties when trying to use
Effect.SlideDown(). I am using script.aculo.us version 1.8.1.

HTML

<div>( <a href="javascript:show_hide($('forgot_password'));">Forgot
Password?</a> )</div>
<div id="forgot_password" style="display: none;">** Username /
Password Reset Here **</div>

JavaScript

function show_hide(element) {
if(element.style.display == "none") {
new Effect.SlideDown(element, { duration: 1, sync: true });
}
else {
new Effect.SlideUp(element, { duration: 1, sync: true });
}
}

Thanks for the help.

kangax

unread,
May 11, 2008, 2:28:11 AM5/11/08
to Ruby on Rails: Spinoffs

JustinK101

unread,
May 11, 2008, 6:12:53 PM5/11/08
to Ruby on Rails: Spinoffs
Nope, same error without 'new'. Any other ideas? Thanks.

Thomas Fuchs

unread,
May 12, 2008, 2:59:40 AM5/12/08
to rubyonrail...@googlegroups.com
Hey,

RTFM -- 2 Things:

a) you need to add a wrapper div inside your forgot_password div (see
Notes on
http://github.com/madrobby/scriptaculous/wikis/effect-slidedown)

b) You want queue: 'end' instead of sync: true.
The sync option is only for use with Effect.Parallel, as detailed on http://github.com/madrobby/scriptaculous/wikis/core-effects

Best,
Thomas

Christophe Porteneuve

unread,
May 12, 2008, 5:58:09 AM5/12/08
to rubyonrail...@googlegroups.com
Why the hell do you use "sync: true" in the effect, as it apparently is
not used anywhere within a Effect.Parallel? This option will replace
the effect's internal proceeding engine with a reliance on an external
Effect.Parallel processing.

Try without it (and yes, without "new" as well: SlideDown is not a
constructor).

--
Christophe Porteneuve aka TDD
t...@tddsworld.com

Reply all
Reply to author
Forward
0 new messages