Cool thanks. I'll try that and see how we go.
Iggy
On 2/23/07, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
>
> Hey Iggy,
>
> Iggy Sandejas a écrit :
> > Complete Code is:
> > Event.observe(window,'load',function(){
> > Event.observe('hardware-link','click',function(){
> > new Effect.ScrollTo('current',{offset: -10});
> > return false;
> > });
> > })
>
> 'K. So when you click on #hardware-link, you expect a ScrollTo effect
> over #current, is that right?
>
> This should cut it, BUT, your using "return false" is *not* the portable
> way of cancelling events. In Prototype, as you were told by a previous
> answer, you need to properly manipulate the event object for the current
> event. Your handler's return value is of no account.
>
> Try this:
>
> Event.observe(window,'load',function(){
> Event.observe('hardware-link','click',function(e){
> Event.stop(e);
> new Effect.ScrollTo('current', {offset: -10});
> });
> })
>
> (Note the *e* argument to your handler)
>
> 'HTH
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---