Hi,
   After checking Event.stop in Prototype's API Docs,i wrote an
example to test Event.stop method's function just now.
   The test scene is like:
   Some hyperlinks with their respective href property(link to other
pages).
   Now,i wanna use Event.stop method to cancel those hyperlinks'
default behaviors,it means that  they no longer link to those pages
specified in href attribute in expect,right?
   So,i write my code as below:
                        Event.observe(window,"load",init);
                        function init(){
                                $("menu").observe("click",function(event){
                                var target=Event.element(event);
                                alert(target.innerHTML);//for test,it show 
nothing when click a
link.
                                Event.stop(event);
                                });
                        }
But it doesn't work in expect,the hyperlinks are still behaving their
default behaviors,linking to other pages...
Why?
The exact example please view on:
http://pastie.caboo.se/51837


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to