Hi, > In this case var element = Event.findElement(ev); seems to return the > image and not the link. Any other way to fix this?
Event#findElement has exactly the functionality you need, I'd give the docs[1] a good read. [1] http://prototypejs.org/api/event/findelement HTH, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Jul 7, 1:36 pm, David Behler <d.beh...@gmail.com> wrote: > Some time ago I came across the blog of David Walsh and his article on > "Animated Ajax Record Deletion Using MooTools" (http://davidwalsh.name/ > animated-ajax-record-deletion-mootools). Sadly he uses MooTools and > not Prototype. But as I'm more and more trying to create my own > classes based on Prototype I wanted to create this functionality > myself! > > And now it's done: Deletr is born! > > A demo can be viewed here:http://www.davidbehler.de/projects/deletr > You can download it from here:http://www.davidbehler.de/index.php/file/view/8 > > I would really like to know what you guys think of this! > > You might notice this: > if(!element.match('a')) { > element = element.ancestors()[0]; > } > I did this in case it's not a link you click on but an image that's > wrapped in a link, e.g. <a href="test.php"><img src="test.png" /></a> > In this case var element = Event.findElement(ev); seems to return the > image and not the link. Any other way to fix this? > > Greetz > Davd --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---