Click to See Complete Forum and Search --> : open window?
scatmac
03-11-2003, 01:19 PM
Hi, I have a slight problem & not being a switched on Java person makes it very frustrating for me
:confused:
I have 500+ photos that I would like to open in a window when someone clicks the thumbnail of that photo. Trouble is I don't want to code 500+ html docs, just 1 window that the photo changes in.
Can this be done?
Regards
Scat
Vladdy
03-11-2003, 01:23 PM
Originally posted by scatmac
I would like to open in a window
Imagine you are sitting in a living room, enjoying the view outside, and then I come along and start hacking a new window in your wall, just because I think I will look better to you this way :rolleyes: :rolleyes: :rolleyes:
DoLordBoy
03-11-2003, 01:28 PM
I"m not sure how you could use this with javascript, unless you wanted to format the window size, but I can imagine you could just link straight to <a href="image.gif" target=_display>
Dunno if this would work
Try something like this:
<a href="yourlarger.gif" onClick="window.open(this.href,'winname','width=325,height=325'); return false;"><img src="thumbnail.gif" height="20" width="20" border="0"></a>
scatmac
03-11-2003, 03:23 PM
Originally posted by Vladdy
Imagine you are sitting in a living room, enjoying the view outside, and then I come along and start hacking a new window in your wall, just because I think I will look better to you this way :rolleyes: :rolleyes: :rolleyes:
& of course, you being the supreme master really helped:D
scatmac
03-11-2003, 03:25 PM
Originally posted by pyro
Try something like this:
<a href="yourlarger.gif" onClick="window.open(this.href,'winname','width=325,height=325'); return false;"><img src="thumbnail.gif" height="20" width="20" border="0"></a>
Thanks but that's sort of what I have already & the new pop up window doesn't allow me to set background colours & any other graphics I want to add in :( it's purely the actual large image. Thanks anyway
Regards
Mac
Originally posted by scatmac
Thanks anywayDon't give up on me so soon...I've still got the solution for you... :D
<html>
<head>
<title>Untitled</title>
<script language="javascript" type="text/javascript">
function openpic(img,title,width,height)
{
picwin = window.open('','','width='+width+',height='+height+'')
picwin.document.write(
'<html>',
'<head>',
'<title>'+title+'</title>',
'</head>',
'<body bgcolor="darkblue">',
'<img src="'+img+'">',
'</body>',
'</html>' //no comma after last line
);
}
</script>
</head>
<body>
<a href="your.gif" onClick="openpic(this.href,'Page Title','325','325'); return false;">open</a>
</body>
</html>
and, in the onClick part, leave this.href alone, but the second, third, and fourth values you can chage. The first is the page title, the second is the width of the window, and the third is the height of the window. Look pretty close? ;)