|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
settimeout ignore object in function
using settimeout recalling the function, an object of params
isnt recognized. here is the code: function ajusta(inp,ind,mai,raxa) { var taxa = 0; taxa = parseInt(ind/mai * 196); inp.style.height = taxa + 'px'; inp.value = raxa * (ind/taxa); if (taxa != raxa) {raxa++; setTimeout("ajusta('"+inp+"','"+ind+"','"+mai+"','"+raxa+"')",100) } } inp is an form input type text, ind, mai and raxa are just numbers when the settimeout calls the function again inp is no more the initial object i'm breaking my head all day trying to solve this,, please any help is welcome. Hugs from Brasil. |
|
#2
|
||||
|
||||
|
function problem
Javascript is a loosely typed language.
I believe that this line inp.value = raxa * (ind/taxa); is recasting the string inp, as an int. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > settimeout ignore object in function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|