Michael Satterwhite wrote:
A little more information. The page is being built on the server
(with the single image), and the size may vary. I'd like to pass the image size
back to the main window and have javascript resize it at presentation time
to the size of the image. (All other suggestions gratefully accepted).
I've tried the following:
window.menubar. visible=false;
window.director ies.visible=fal se;
window.statusba r.visible=false ;
window.toolbar. visible=false;
window.location bar.visible=fal se;
window.personal bar.visible=fal se;
window.scrollba rs.visible=fals e;
which I thought would eliminate the distractions at the top - and (I
hoped) the problem, but this code didn't seem to have any effect. All of the
garbage at the top was still there.
Any suggestions?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PicUp</title>
<base href="http://www.johnleeart. com/Europe/" />
<style type="text/css">
body {
margin: 40px 0 0 0;
background: #806030;
}
a.PU img {
display: block;
margin-bottom: 4px;
border: 1px #000 solid;
border-left: 24px #403010 solid;
}
</style>
<script type="text/javascript">
PicUp.win = null;
PicUp.sticky = true;
PicUp.clickclos e = true;
function PicUp(url, title)
{
if (PicUp.win && !PicUp.win.clos ed)
PicUp.win.close ();
var plObj = new Image;
plObj.onload = function()
{
var w = this.width;
var h = this.height;
var config = [
'width=' + w , 'height=' + h ,
'left=' + (screen.availWi dth - w - 10) * .5 ,
'top=' + (screen.availHe ight - h - 10) * .5 ,
'status=0'
].join(',');
PicUp.HTML = [
'<html><head><t itle>' + title + '</title></head>' ,
'<body style="margin:0 ;background:bla ck;overflow:hid den;"' ,
((PicUp.sticky) ? ' onblur="setTime out(\'top.focus ()\',200)"' : '')
,
((PicUp.clickcl ose) ? ' onclick="top.cl ose()"' : '') ,
'><img style="border-width:0;cursor: pointer;"' ,
((PicUp.clickcl ose) ? ' title="click to close"' : '') ,
' src="' + this.src + '"></body></html>'
].join('');
PicUp.win = window.open('ja vascript:opener .PicUp.HTML', 'picwin',
config);
if (PicUp.win && !PicUp.win && PicUp.win.focus )
PicUp.win.focus ();
}
plObj.onerror = function()
{
alert('Larger size not available, sorry...');
}
plObj.alt = title;
plObj.src = url;
return false;
}
</script>
</head>
<body>
<div id="container" >
<a class="PU"
title="Afternoo n In Alhambra"
target="_blank"
href="images/AfternoonInAlha mbra01.jpg"
onclick="return PicUp(this.href ,this.title)">
<img
alt="Thumbnail - Click for fullsize image"
src="thumbnails/AfternoonInAlha mbra01.jpg" />
</a>
<a class="PU"
title="Apartmen ts In Muslin Quarter"
target="_blank"
href="images/ApartmentsInMus linQuarter.jpg"
onclick="return PicUp(this.href ,this.title)">
<img
alt="Thumbnail - Click for fullsize image"
src="thumbnails/ApartmentsInMus linQuarter.jpg" />
</a>
<a class="PU"
title="Empire's Glory Days"
target="_blank"
href="images/EmpuriesGloryDa ys.jpg"
onclick="return PicUp(this.href ,this.title)">
<img
alt="Thumbnail - Click for fullsize image"
src="thumbnails/EmpuriesGloryDa ys.jpg" />
</a>
<a class="PU"
title="Merry-Go-Round"
target="_blank"
href="images/MerryGoRound.jp g"
onclick="return PicUp(this.href ,this.title)">
<img
alt="Thumbnail - Click for fullsize image"
src="thumbnails/MerryGoRound.jp g" />
</a>
</div>
</body>
</html>
Might as well cover my ass: this code is bad.
Pop-ups: really bad, may be blocked (bad).
Messing w/window unreliable. Focussing, bad.
Have fun. ~:>)