[Proto-Scripty] Re: Prototype toggle works, Scriptaculous effect fails

2010-01-21 Thread kenxle
I stand corrected!

When I took the quotes out, I tested the wrong element.
Effect.toggle(y.element().id+"AddrDIV"); works!!

I thought scriptaculous overrode the prototype commands. Now I know!

Thanks,
Ken

On Jan 21, 9:49 am, kenxle  wrote:
> ID in quotes:
> Embarrassing mistake to be sure, but that didn't fix it. Plus, I've
> written and unwritten that statement so many times, I'm sure I did it
> correctly one of the times. :)
>
> Toggle params:
> Scriptaculous has default params. If you don't specify, it chooses
> 'fade' for you. And I've tried it with the effect param too.
>
> DOM structure:
> I usually pay attention to this, but I'll go read the article and see
> if there's something there that helps.
>
> Thanks,
> Ken
>
> On Jan 21, 6:25 am, "T.J. Crowder"  wrote:
>
> > Hi,
>
> > Caveat: I don't use script.aculo.us, but I run across it a lot because
> > I use Prototype. :-)
>
> > > $(y.element().id+"AddrDIV").toggle('slide'); //toggles correctly,
>
> > but without effect
>
> > That's because Element#toggle is a Prototype thing[1]. I don't think
> > script.aculo.us overwrites it (but I could be wrong).
>
> > > //new Effect.toggle('y.element().id+"AddrDIV"', 'slide'); //doesn't
>
> > work at all
>
> > You've put the ID in quotes, and so the ID it's looking for literally
> > is 'y.element().id+"AddrDIV"'. Without the quotes, it should work
> > (provided the target element exists). I think that Effect.toggle
> > probably wants a parameter, though, to tell it *how* to toggle (slide,
> > etc.). Also, be sure your DOM structure is correct; see the notes on
> > the Effect.toggle documentation page[2].
>
> > [1]http://api.prototypejs.org/dom/element.html#toggle-class_method
> > [2]http://wiki.github.com/madrobby/scriptaculous/effect-toggle
>
> > HTH,
> > --
> > T.J. Crowder
> > Independent Software Consultant
> > tj / crowder software / comwww.crowdersoftware.com
>
> > On Jan 21, 12:11 am, kenxle  wrote:
>
> > > Hi, I've been beating my head over this issue for the last two days,
> > > so I appreciate in advance any help that is given.
>
> > > I've got Prototype set up in an "unobtrusive" style, which I much
> > > prefer, but I can't seem to get the scriptaculous effects to work.
> > > When I put the scriptaculous calls inline in the HTML, they work
> > > correctly, so I know the files are linked correctly. Here's a code
> > > snippet.
>
> > >  > > script>
> > >