Re: [Proto-Scripty] Morph and setTimeout

2010-07-20 Thread Ralph Brickley
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.



Re: [Proto-Scripty] Morph and setTimeout

2010-07-20 Thread Walter Lee Davis
The setTimeout only knows what the value of id is when it is created,  
not when it is invoked. So it's telling you the truth. At the moment  
when the page loaded, there was no value for id, so there still isn't  
one inside of setTimeout's little bubble.


There's a nice feature in all the Effects that you should use instead:  
afterFinish.


function expandir(id,newh){
   new Effect.Morph('cont'+id, {
style: 'height:'+newh+'px;', // CSS Properties
duration: 0.5,
afterFinish: function(){ Element.show.delay(0.5, 'masinfo'+id)}
   });
}

That's not tested, but it should get you close.

Walter

On Jul 20, 2010, at 3:59 PM, Martín Marqués 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-scriptaculous@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.



RE: [Proto-Scripty] Morph and setTimeout

2010-07-20 Thread Rick . Wellman
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.



RE: [Proto-Scripty] Morph and setTimeout

2010-07-20 Thread Rick . Wellman
Oops, already made a mistake;  Make that:

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

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

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.

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



Re: [Proto-Scripty] Morph and setTimeout

2010-07-20 Thread Martín Marqués
2010/7/20 Rick.Wellman rick.well...@kiewit.com:
 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);

This was the first thing I tried out yesterday, and it didn't work.

Thanks anyway.


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



Re: [Proto-Scripty] Morph and setTimeout

2010-07-20 Thread Martín Marqués
2010/7/20 Rick.Wellman rick.well...@kiewit.com:
 Oops, already made a mistake;  Make that:

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

Yeah, this is how I made it work, but it's not pretty at all.

Walter gave me the beautiful afterFinish.

Thanks Walter!

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



Re: [Proto-Scripty] Morph and setTimeout

2010-07-20 Thread Ralph Brickley
AfterFinish!!! Brilliant. 

Sent from my iPhone

On Jul 20, 2010, at 2:15 PM, Martín Marqués martin.marq...@gmail.com wrote:

 2010/7/20 Rick.Wellman rick.well...@kiewit.com:
 Oops, already made a mistake;  Make that:
 
 var cmd = $('masinfo' + id + ).show();
 setTimeout(cmd,500,id);
 
 Yeah, this is how I made it work, but it's not pretty at all.
 
 Walter gave me the beautiful afterFinish.
 
 Thanks Walter!
 
 -- 
 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.