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