Hey Guys I am having trouble fading out a Div in my HTML document. I am able to use the same function reversed and am able to fade the divs in as required but not out. Any ideas?
Here is the JavaScript function:
function fadeOut(node, duration) {
var increments = 100;
var increment_value = 1/increments;
var interval = duration/increments;
var opacity = 1;
var repeater = setInterval( function() {
if (opacity > 0) {
opacity = opacity - increment_value;
node.style.opacity = opacity;
} else {
clearInterval(repeater);
}
}, interval);
}
jQuery fadeIn()?