lloydwatkin
09-05-2003, 08:10 AM
Hi,
Thanks for all that helped me earlier, I have now written a script popup.js which controls the popup window for files in various directories:
function openpopup(popurl,poptitle){
if (poptitle.value == 'undefined')
{
var poptitle = '';
alert(poptitle)
return true;
}
winpops=window.open('','newWin',"width=660,height=500,leftmargin='0',topmargin='0',marginwidth='0',marginheight='0");
winpops.document.write("<HTML><TITLE>"+poptitle+"</TITLE><CENTER><IMG src="+popurl+" ></CENTER></HTML>");
}
Now in my page I have the following two types of link:
<a href="javascript:openpopup('pic004.JPG');return true;"><img src="004.JPG" alt="Alt Text 1"></a>
<a href="javascript:openpopup('pic005.JPG')">
<img src="005.JPG" OnClick="javascript:openpopup('pics/005.JPG',this.alt)" alt="Alt Text 2"></a>
The second type I click on and hey prestop up comes my popup window with alt tag title. The first link however does not work, when clicking on it nothing happens. This only occured when I added the if statement to the popup.js file, this was because when poptitle wasn't being sent by the "a href" link the window title was "undefined" and in this case I'd prefer it to be the file name/directory.
Can anyone help???
Thanks
Lloyd (http://www.evilprofessor.co.uk)
To see the page this relates to goto http://www.evilprofessor.co.uk/photos/egypt/cairo/around/
Thanks for all that helped me earlier, I have now written a script popup.js which controls the popup window for files in various directories:
function openpopup(popurl,poptitle){
if (poptitle.value == 'undefined')
{
var poptitle = '';
alert(poptitle)
return true;
}
winpops=window.open('','newWin',"width=660,height=500,leftmargin='0',topmargin='0',marginwidth='0',marginheight='0");
winpops.document.write("<HTML><TITLE>"+poptitle+"</TITLE><CENTER><IMG src="+popurl+" ></CENTER></HTML>");
}
Now in my page I have the following two types of link:
<a href="javascript:openpopup('pic004.JPG');return true;"><img src="004.JPG" alt="Alt Text 1"></a>
<a href="javascript:openpopup('pic005.JPG')">
<img src="005.JPG" OnClick="javascript:openpopup('pics/005.JPG',this.alt)" alt="Alt Text 2"></a>
The second type I click on and hey prestop up comes my popup window with alt tag title. The first link however does not work, when clicking on it nothing happens. This only occured when I added the if statement to the popup.js file, this was because when poptitle wasn't being sent by the "a href" link the window title was "undefined" and in this case I'd prefer it to be the file name/directory.
Can anyone help???
Thanks
Lloyd (http://www.evilprofessor.co.uk)
To see the page this relates to goto http://www.evilprofessor.co.uk/photos/egypt/cairo/around/