In trying to use this, I ended up setting an alert on the result of the
Event.element call:
var el = Event.element(event);
alert (el);
What I get back is object[IMG], when I am expecting an A.
My outer loop is looking for $$('a.citation'), and feeding the result
into the anonymous function generator. Why then is the target of the
click event the image rather than the a?
How can I trap this and work around it?
Thanks,
Walter
On Aug 23, 2007, at 8:08 PM, Martin Bialasinski wrote:
>
> On 8/24/07, Walter Lee Davis <[EMAIL PROTECTED]> wrote:
>> The page works perfectly in Safari 2 and Firefox 2, but stubbornly
>> navigates to the target of the link when clicked in Safari 1.3.9.
>
> My Event.stop() function (Prototype 1.4 based):
>
> stop: function(event) {
> if (event.preventDefault) {
> event.preventDefault();
> event.stopPropagation();
> if (isKHtml) {
> var element = Event.element(event);
> var oldhref = element.href;
> element.href = 'javascript:void 0';
> (function(){ element.href = oldhref; }).delay(1);
> }
> } else {
> event.returnValue = false;
> event.cancelBubble = true;
> }
> },
>
> You will need to adapt it, obviously. .delay() is a setTimeout wrapper
> and isKHtml is true for Safari.
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---