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

Jacob Reiff jacob at jaacob.com
Wed Mar 22 09:57:02 CST 2006


On Mar 22, 2006, at 5:42 AM, Tom Dell'Aringa wrote:

> Hey folks,
>
> I've been trying to implement an Effect using script.aculo.us for a  
> couple
> days, wondering if any of you have any expertise with it (no luck  
> in finding
> any active forums or discussion boards covering it). Essentially  
> all I want
> to do is use the Effect.Appear() to show a hidden div. Any other  
> effect I
> seem to trigger works fine with this div, other than Appear. I've  
> tried both
> display: none and visibility: hidden. It's really hard to tell what is
> exactly going on, there are no errors, but the div does not appear.  
> With the
> prototype and scriptaculous scripts called in the page, this is the  
> simple
> code:
>
> <input type="button" onclick="new
> Effect.Appear(document.getElementById('overlay'))"
> value="go" />

Tom,

Two things I found by testing on my own site with script.aculo.us.

One - I think your onclick syntax is wrong. You don't need to use  
document.getElementById - just the name of the id. Here's what I use,  
and it works:

	onclick="Effect.Appear('overlay');"

The second problem with script.aculo.us not "seeing" the div, I found  
was solved by making it hidden via inline CSS. For some reason, when  
the div is hidden via an external style sheet, the effect never  
works. But on my divs that start out hidden, I have a simple  
style="display: none;" and then the effect works fine. No idea why  
this is, it's just the only way I found it to work. All the other  
effects work when an external style sheet is called (from what I can  
tell), but if it starts out hidden, it has to be done inline.

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

Jacob



More information about the thelist mailing list