I'm pretty sure Ralph's suggestion will work.  I prefer to write this in a way 
which will hopefully highlight the potential "bug" to a less-experienced 
maintenance developer after I have moved onto a 6-digit consulting career that 
I run two-hours a day from the Bahamas (boy, sure hope my idea works or that 
consulting career is a pipe-dream):

var elid = 'masinfo' + id;
setTimeout("$(elid).show()",500,id);

-----Original Message-----
From: prototype-scriptaculous@googlegroups.com 
[mailto:prototype-scriptacul...@googlegroups.com] On Behalf Of Ralph Brickley
Sent: Tuesday, July 20, 2010 3:04 PM
To: prototype-scriptaculous@googlegroups.com
Subject: Re: [Proto-Scripty] Morph and setTimeout

JavaScript doesn't know what the +id is because it's within the double quotes. 

Do this instead 

> setTimeout("$('masinfo'"+id+").show()",500,id);
> }

Sent from my iPhone

On Jul 20, 2010, at 12:59 PM, Martín Marqués <martin.marq...@gmail.com> wrote:

> I'm trying to mix Effect.Morph and setTimeout() to enlarge a div and
> after the div finishes enlargening another div inside it appears (this
> is where I use setTimeout()). The problema is that I get a error and
> can't find out why.
> 
> Here is the code:
> 
> function expandir(id,newh){
>    new Effect.Morph('cont'+id, {
>    style: 'height:'+newh+'px;', // CSS Properties
>    duration: 0.5 // Core Effect properties
>    });
> 
>    setTimeout("$('masinfo'+id).show()",500,id);
> }
> 
> Here it says that id is not defined in the setTimeout line.
> 
> Any ideas?
> 
> -- 
> Martín Marqués
> select 'martin.marques' || '@' || 'gmail.com'
> DBA, Programador, Administrador
> 
> -- 
> 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-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 

-- 
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-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
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-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to