I have found this script. but i want to display another image instead of the text "SOME TEXT".
$(document).ready(function()
{
setTimeout(function()
{
$("div#outer").fadeOut("slow", function ()
{
$("div#outer img").remove();
$("div#outer").html($("div#text").text());
$("div#outer").show();
});
}, 5000);
});
<div id="outer"><img src="http://existdissolve.com/wp-content/uploads/2010/08/microsoft-logo-64x64.png" alt="" /></div>
<div id="text" style="display:none">SOME TEXT</div>
You can change the image src or remove image and create a new one with some dynamic id or smth.
Here is a js fiddle : https://jsfiddle.net/s57qok3n/.
HTML:
JS:
And if you want to change only the src attribute, here you go:
Working js fiddle: https://jsfiddle.net/4faco2d9/