On 3/24/07, David Dashifen Kees <[EMAIL PROTECTED]> wrote:
>
> So, one of the things I've always wanted to do was expand upon the
> simplicity of the Lightbox Gone Wild! object that the coders at
> www.particletree.com put together months ago. I used it on an
> application I wrote to organize my own picture albums on my localhost
> web server, but I had to hack it apart to get it to do the things I
> wanted it to do. I looked at the Prototype Window class, thick box,
> grey box, etc. and all of them didn't seem to be quite what I was
> looking for. So, this afternoon I decided to try and write one myself.
> I've gotten about 95% of the way completed (at least for the first go)
> but I can't get the dialog, after it is shown, to disappear.
>
> Here's a pastie: http://pastie.caboo.se/49182
> Here's a demo: http://www.dashifen.com/.temp/
>
> You can see at line #19 within the pastie that I'm trying to get
> anything within the newly loaded div#dialog element which an action
> attribute equal to "deactivate" and then capture click events to close
> the dialog. If I change line #20 to include an anonymous function
> (element.observe("click", function() { alert("hello world"); }); for
> example), the anonymous function works fine. I suspect I'm still hazy
> on the exact usage (and purpose) of the bindAsEventListener() method of
> the Function object.
>
> Anyone got any ideas about how to get the darned things to close when
> they're opened?
$("dialog").getElementsBySelector("[action=deactivate]").each(function(e){
e.observe('click', function(){
$("dialog").remove(); $('overlay').remove()
})
});
> Also, for what it's worth, I'm not even worrying about anything other
> than Firefox at this point. The first step is to get it working. I'll
> worry about getting working in other browsers as phase 2!! Also, FYI,
> I'm using prototype.js version 1.5.1 release candidate 2.
>
> Thanks All,
> -- Dash --
>
> >
>
--
Regards, Kjell
www.m3nt0r.de
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---