function fadeIn(elem){
element = elem.nextSibling;
elemOpacity = element.style.opacity;
element.innerHTML = elemOpacity;
if (elemOpacity < 1.0)
element.style.opacity = parseFloat(elemOpacity) + 0.1;
timeIn = setTimeout(fadeIn, 100);
}
[FONT=Arial]
I have used the opacity property to make fading element [/FONT]like fadeIn() function in jquery , and i have used onfocus event to execute the code .
Problem exists in setTimeout [FONT=Arial]function, this function Does not work But the code works without this function
[/FONT] What is the cause of the problem , Please help me
Sometimes the content of the inner function can be quite complex, so when you revisit the code later on, it can be tricky to determine the reason for why this design of code has been done. By calling the outer function with the variable(s) that you need to retain, that helps to inform you about why such a technique is used.
It also means that the inner function is not relying on an assumption that the variables that it requires will be available at some higher scoped level. Instead, you are explicitly making sure that the requirements for the inner function are provided, which is a better type of coding technique to apply.
Thank You very muchMr pmw57for solution
And i have found the solution that you typed is the easiest solution I have seen so far .
The code that you typed easy to understand But there is a point in the code not understood
Why do you add COLOR=Red[/COLOR] argument again in this place , While you have added previously fadeIn(elem) .
This point, I did not understand well I hope to clarify more