Yeah, i discovered the same gotcha...

the JS should actually look like this:

    document.observe('dom:loaded', function () {
      $$('.blinders').each(function (b) {

        b.observe('click', function () {
          Effect.toggle(this.next(), 'blind');
          // or like this if you used the second version posted:
Effect.toggle(this.down(), 'blind');
        });
      });
    });

On Thu, Jun 4, 2009 at 3:31 PM, craig <bagley.cr...@gmail.com> wrote:

>
> I've implemented what Rick (Thank You!) suggested, and it seems to
> have solved the recognition problem.  The only minor problem I'm still
> having is that instead of a sliding effect, the div just abruptly
> appears without sliding.  It's as if it knows the div needs to be
> displayed onclick, but not that it should call a slide.  I'm assuming
> its because I'm just using <script> tags as opposed to pasting that
> into one of the js files.  Which file should I be putting it in?  I
> examined the scriptaculous and prototype files for similar looking
> code, but being a supernoob I'm reluctant to just throw it in
> there.
>
> On Jun 4, 2:29 pm, Rick Waldron <waldron.r...@gmail.com> wrote:
> > @Alex,
> >
> > I think i met all of your criteria:
> http://genevajs.com/misc/demo-ps-list-0011.php
> >
> > i left the js in the main file so you could reference. dig it.
> >
> > Rick
> >
> > On Thu, Jun 4, 2009 at 12:20 PM, Alex McAuley <
> >
> > webmas...@thecarmarketplace.com> wrote:
> > >  @Rick -- Okay here is a good one.....
> >
> > > A very dynamic site where you need to pull varying variables
> > > -- excuse the psudeo code !! just proving its needed sometimes !!
> >
> > >     funciton doSomething({options}) {
> >
> > >     new Ajax.Updater(options.element,options.url, {
> >
> > >                            method:options.method,
> > >                            evalScripts: options.evalscripts,
> > >                         parameters: {
> > >                                        options.parametersName:
> > > options.params
> > > }
> > > onComplete: options.onCompleteFunction // Not sure if would work - as
> i've
> > > never tried
> >
> > > });
> >
> > > }
> >
> > > <div
> > >
> onclick="doSomething({element:'myDiv',url:'myurl.php',evalscrips:true,parametersName:'postbody',params:'<?php
> > >
> echo($myVeryDynamicVariableIJustRecievedFromAnotherAjaxRequestThatTheDocumentCouldNotPossiblyKnowWithoutUpdatingLotsOfHiddenVariables);
> ?>',onCompleteFunction:'function(){alert(\'Hi\');}'});">
> > > </div>
> >
> > > Now without inline handlers i would have to make alot of functions..
> this
> > > way i can reuse my code and just change the inputs ....
> >
> > > I will state i dont do this often but sometimes it is needed as a
> script
> > > cannot always get the variables it needs as some change dynamically
> from
> > > other requests and outside factors
> >
> > > I built an extremely dynamic Web Desktop over the last 2 years which is
> > > alot faster than anything else out there... One of the main factors it
> stays
> > > fast is the client memory is not clogged up with huge initial downloads
> of
> > > functions that only get used every now and again!.
> >
> > > My view is each to thier own .... If it aint broke dont fix it and if
> > > everyone wrote code the same then the internet would be boring !!
> >
> > > I would be interested to see how you would tackle problems like the one
> > > above as i've never really discussed it with anyone before
> >
> > > Regards
> > > Alex
> >
> > > ----- Original Message -----
> > > *From:* Rick Waldron <waldron.r...@gmail.com>
> > > *To:* prototype-scriptaculous@googlegroups.com
> > > *Sent:* Thursday, June 04, 2009 4:06 PM
> > > *Subject:* [Proto-Scripty] Re: Working outside loop, but not inside
> >
> > > A quick google for "php single quotes vs double quotes" will help you
> > > understand the difference and what it means to the overhead and
> scalability
> > > of your code. I picked this article from said google results:
> >
> > >http://andrewgatenby.com/single-quotes-and-double-quotes-in-php
> >
> > > @Alex,
> > > I honestly can't think of any scenario where it is ok to use inline
> > > handlers, but I'm definitely interested in hearing your argument
> regarding
> > > them. I'm of the belief that complete separation of logic is imperative
> and
> > > should be regarded as best practice (or even, "only practice")...
> thoughts?
> >
> > > @Craig,
> > > Apparently Effect.toggle() does not like the element chained to it...
> odd.
> > > Anyway, you can improve this much further.... I've posted a demo.
> > >http://genevajs.com/misc/demo-ps-list-0010.php
> >
> > > Rick
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to