image popup window title

S

skim1114

I have this code in my popup window, which works perfectly except that
I need it to display a new title for every image.

Here the popup window code:
<HTML>
<HEAD>
<TITLE>DETAIL</TITLE>
<script language='javascript'>
var temp=self.location.href.split("?");
var picUrl = (temp.length>1)?temp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

function fitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight-1);
self.focus();
};
</script>
</HEAD>
<BODY bgcolor="#FFFFFF" onload='fitPic();' topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" +picUrl +"' border=0>" );
</script>
</BODY>

</HTML>

I know it's somewhere in the document.write part, but i'm not sure. So
if my image link is:
javascript:popupPic('images/large1/detail/6detail_03.jpg','new popup
title')

It will insert the image and place in the new title.

Thanks
 
R

Randy Webb

(e-mail address removed) said the following on 6/11/2006 12:30 PM:
I have this code in my popup window, which works perfectly except that
I need it to display a new title for every image.

Then do so.
Here the popup window code:
<HTML>
<HEAD>
<TITLE>DETAIL</TITLE>
<script language='javascript'>
var temp=self.location.href.split("?");
var picUrl = (temp.length>1)?temp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

Ditch that code, it is not needed.
function fitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;

iWidth=(window.innerWidth)?window.innerWidth:document.body.clientWidth;

No reliance on the unreliable userAgent string. Test for the feature you
want to use.
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
Ditto.

iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight-1);
self.focus();
};
</script>
</HEAD>
<BODY bgcolor="#FFFFFF" onload='fitPic();' topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" +picUrl +"' border=0>" );
</script>
</BODY>
</HTML>

I know it's somewhere in the document.write part, but i'm not sure.

No, it's not.

document.title="new title with some caveats";
So if my image link is:
javascript:popupPic('images/large1/detail/6detail_03.jpg','new popup
title')

Thats a bad way to write a link. Read the group FAQ with regards to
using the javascript: pseudo-protocol.
It will insert the image and place in the new title.

Only if PopupPic uses the second parameter as the title of the new
window and passes it to the new page. But as written, it doesn't even
use the first parameter it is passed.
 
S

skim1114

Thanks for the hints. Honestly, I gotta say, most of that went over my
head and I am left still just as perplexed as before.



Randy said:
(e-mail address removed) said the following on 6/11/2006 12:30 PM:
I have this code in my popup window, which works perfectly except that
I need it to display a new title for every image.

Then do so.
Here the popup window code:
<HTML>
<HEAD>
<TITLE>DETAIL</TITLE>
<script language='javascript'>
var temp=self.location.href.split("?");
var picUrl = (temp.length>1)?temp[1]:"";
var NS = (navigator.appName=="Netscape")?true:false;

Ditch that code, it is not needed.
function fitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;

iWidth=(window.innerWidth)?window.innerWidth:document.body.clientWidth;

No reliance on the unreliable userAgent string. Test for the feature you
want to use.
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
Ditto.

iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight-1);
self.focus();
};
</script>
</HEAD>
<BODY bgcolor="#FFFFFF" onload='fitPic();' topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" +picUrl +"' border=0>" );
</script>
</BODY>
</HTML>

I know it's somewhere in the document.write part, but i'm not sure.

No, it's not.

document.title="new title with some caveats";
So if my image link is:
javascript:popupPic('images/large1/detail/6detail_03.jpg','new popup
title')

Thats a bad way to write a link. Read the group FAQ with regards to
using the javascript: pseudo-protocol.
It will insert the image and place in the new title.

Only if PopupPic uses the second parameter as the title of the new
window and passes it to the new page. But as written, it doesn't even
use the first parameter it is passed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top