W
WindAndWaves
Hi Gurus
I have the following code:
function CI(ImgN, Alt){
if( document.getElementById && document.getElementById('il') ){
var d=document.getElementById('il');
if(document.createElement){
var i=document.createElement('img');
i.src="i/" + ImgN;
i.className='l';
i.alt=Alt;
while(d.firstChild!==null){
d.removeChild(d.firstChild);
}
d.appendChild(i);
return false;
}else if(d.innerHTML){
d.innerHTML='<img src="i/' + ImgN + '" class="l" alt="' + Alt + '"
ONCLICK="return XI()">';
return false;
}else {
return true;}
} else {
return true;}
}
I now want to add the onclick event to the img (so that the user can close
it), how do I do that, or can I simply add a bit of text at the bottom of
the image 'close image' (and how do I do that??)?
TIA
- Nicolaas
I have the following code:
function CI(ImgN, Alt){
if( document.getElementById && document.getElementById('il') ){
var d=document.getElementById('il');
if(document.createElement){
var i=document.createElement('img');
i.src="i/" + ImgN;
i.className='l';
i.alt=Alt;
while(d.firstChild!==null){
d.removeChild(d.firstChild);
}
d.appendChild(i);
return false;
}else if(d.innerHTML){
d.innerHTML='<img src="i/' + ImgN + '" class="l" alt="' + Alt + '"
ONCLICK="return XI()">';
return false;
}else {
return true;}
} else {
return true;}
}
I now want to add the onclick event to the img (so that the user can close
it), how do I do that, or can I simply add a bit of text at the bottom of
the image 'close image' (and how do I do that??)?
TIA
- Nicolaas