[Proto-Scripty] Re: show/hide and return false;

2008-12-10 Thread Cyrus

thank you very much :)

On 10 Dez., 14:07, Walter Lee Davis <[EMAIL PROTECTED]> wrote:
> Add one line, as below.
>
> On Dec 10, 2008, at 6:50 AM, Cyrus wrote:
>
>
>
> > Hi,
>
> > I just programmed a simple show/hide feature: You click on a link and
> > extra information is displayed. Click again and it is hidden.
>
> > The link has a href like "#moreInfoContent". When I add an
> > onclick="return false;" I have the desired result that the href is not
> > displayed in the addressbar. When I try to add this return false in my
> > javascript (unobstrusive) it doesn't work for me. The link is
> > displayed in the adress bar so the browser jumps to that position.
>
> > [snip]
>
> > function openMoreInfo(event) {
>
>         Event.stop(event);
>
>
>
> >    if (Element.hasClassName(this, 'more')) {
> >            new Effect.BlindUp(this.identify() + 'Content', { duration: 0.2 
> > });
> > [snip]
>
> You may want to change the use of the word event as a private  
> variable, I know that IE can sometimes get cranky about that (at least  
> that's been my apocryphal observation). I use evt, personally, or some  
> variation like that.
>
> Also, the syntax I wrote works for Prototype 1.5 and up, but the  
> modern cool 1.6+ way would be to write it as event.stop() (or  
> evt.stop() if you're me).
>
> Walter
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: show/hide and return false;

2008-12-10 Thread Walter Lee Davis

Add one line, as below.

On Dec 10, 2008, at 6:50 AM, Cyrus wrote:

>
> Hi,
>
> I just programmed a simple show/hide feature: You click on a link and
> extra information is displayed. Click again and it is hidden.
>
> The link has a href like "#moreInfoContent". When I add an
> onclick="return false;" I have the desired result that the href is not
> displayed in the addressbar. When I try to add this return false in my
> javascript (unobstrusive) it doesn't work for me. The link is
> displayed in the adress bar so the browser jumps to that position.
>
> [snip]

>
> function openMoreInfo(event) {

Event.stop(event);

>
>   if (Element.hasClassName(this, 'more')) {
>   new Effect.BlindUp(this.identify() + 'Content', { duration: 0.2 
> });

> [snip]


You may want to change the use of the word event as a private  
variable, I know that IE can sometimes get cranky about that (at least  
that's been my apocryphal observation). I use evt, personally, or some  
variation like that.

Also, the syntax I wrote works for Prototype 1.5 and up, but the  
modern cool 1.6+ way would be to write it as event.stop() (or  
evt.stop() if you're me).

Walter

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---