Hi everyone,
Is it possible to make fade in and fade out transitions in iframes?
Thanks & Regards
Ravi
Hi everyone,
Is it possible to make fade in and fade out transitions in iframes?
Thanks & Regards
Ravi
you can do it with jquery!
Fading in or out can be achieved by changing the opacity of an element over time, a very simple example:
var iframe = document.getElementById('iframe');
fadeOut(iframe, 1000);
function fadeOut(el, duration) {
/*
* @param el - The element to be faded out.
* @param duration - Animation duration in milliseconds.
*/
var step = 1 / duration * 10,
opacity = 1;
(function(){
if (opacity <= 0) { return; }
el.style.opacity = ( opacity -= step );
setTimeout(arguments.callee, 10);
})();
}
While jQuery is an incredible library your usage of it should be justified by more than just its ability to create fancy effects. A library should be adopted for its completeness and ease of use; not because it happens to offer just one thing you might want to use.