473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

image popup window title

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

Jun 11 '06 #1
2 3161
sk******@gmail.com 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:docum ent.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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 11 '06 #2
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 Webb wrote:
sk******@gmail.com 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:docum ent.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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Jun 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
2
by: Jake | last post by:
Hi, I have a page with a bunch of thumbnails that when clicked, open the full size image in a new window. They are all different sizes and its a bit unprofessional looking. I'd like to find a...
4
by: Peter Kirk | last post by:
Hi, I want to open a popup-window which displays a list to the user. From this list, the user can select an item, and the data regarding this item is then transferred to some fields on the main...
8
by: Michael Satterwhite | last post by:
I'm opening a page that has a single image on it. I'd like to resize the window containing the image to the size of the image (slightly larger OK, not smaller). The width isn't a problem, but the...
1
by: Bill H | last post by:
I run a dbms application that interfaces with the web. This module creates a frames page with two frames ('main' and 'mwinfoframe'). All communication with the dbms is routed through the...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
7
by: fredo | last post by:
I've studied Eric Meyer's pure css popups, version two: http://meyerweb.com/eric/css/edge/popups/demo2.html which pops up an image when I roll over a text link. Now I want to pop up a large...
7
by: hsegoy1979 | last post by:
Dear All Iam using file upload control and i want to display image in another pop up page .But image is not displaying in image control iam sending image path thru querystring . here is my code ...
13
by: Santander | last post by:
there are many versions of JavaScipt image popups exist which show image preview when we click on a thumbnail image to view a larger version. What is the best way?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.