I have the following javascript function to create an image that will show on hover of another image, but the image does not load... just the little symbol that goes in place when it cannot find an image.
What is wrong with this code:
function createimg()
{
var img = new Image();
img.src='images/imageoverlay.png';
img.id = 'span1';
img.style.zIndex = 10;
img.style.position = 'absolute';
img.style.display='none';
img.style.top = '140px';
img.style.padding='10px';
img.style.left='240px';
img.className ='dynamicSpan';
document.body.appendChild(img);
}
The image sits in the images subdirectory to this where this code file sits.