473,748 Members | 5,242 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing pictures

I am new to Javascript programming. I have a page with four small
pictures. I want to click on a picture and have it open up larger in
a popup window.

this is what I am currently using to do this:

<html>
<!-- Generated by AceHTML Freeware http://freeware.acehtml.com -->
<!-- Creation date: 7/24/2003 -->
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title></title>
<meta name="descripti on" content="">
<meta name="keywords" content="">
<meta name="author" content="rd**** *@netzero.net">
<meta name="generator " content="AceHTM L 5 Freeware">

<script language= "Javascript ">

features ="height=325 , width=475";

function ViewPhoto(filen ame)
{
photo=window.op en(filename, "photos", features);
photo.focus();
}

<!-- hide script from older browsers

// end hiding -->

</script>

</head>
<body onunload=photo. close();>
<P ALIGN="CENTER"> <FONT SIZE="4">Click the pictures to make them
larger</font></p><br>
<a href="#" onclick=ViewPho to("images/DCP_0287.jpg")> <img
src="smpics\DCP _0287sm.jpg"></a>
<a href="#" onclick=ViewPho to("images/DCP_0245.jpg")> <img
src="smpics\DCP _0245sm.jpg"></a>
<a href="#" onclick=ViewPho to("images/DCP_0289.jpg")> <img
src="smpics\DCP _0289sm.jpg"></a>
<a href="#" onclick=ViewPho to("images/DCP_0288.jpg")> <img
src="smpics\DCP _0288sm.jpg"></a>
</body>
</html>

What is happening is that the old photo is showing before the new
photo is loaded. What I would like to have happen is to clear the
window of the old photo before the new one loads. Is that possible
with javascript and how would I do that?

this page is located at http://www.freewebs.com/glorybound/test3.htm

Thanks in advance for any help regarding this problem.
Jul 20 '05 #1
1 4363
"Grant Wagner" wrote
Geoff Tucker wrote:
now open new window:

features ="height=325 , width=475";
The attribute string passed to window.open() should be a

comma-delimited list of attributes and should not contain any additional whitespace. Some browsers will ignore the entire attribute argument if there are spaces in it.


Noted, thanks.

To OP:

In my previous post, I forgot to initially declare new window variable:

var photo = null;

function ViewPhoto(filen ame)
{
features = "height=425,wid th=625";

if(photo != null && !photo.closed)
{
photo.close();
}
photo=window.op en(filename, "photos", features);
photo.focus();
}

Jul 20 '05 #2

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

Similar topics

1
2061
by: David | last post by:
Hi, I have a webpage where I want to have a select list which the user can select between two different pictures, and then the chosen picture loads onto the html page, but without having to reload the actual page. At the moment, what I have is a select list as shown below: <form name="orders"> <select name="picture" size="1"> <option value="pic1.jpg">Picture 1</option> <option value="pic2.jpg">Picture 2</option>
23
2690
by: Wade | last post by:
08122005 1505 GMT-5 Hello. I am working on a webpage for the local school (just before school starts). Their outside hired company really screwed things up. Im trying to get their computers up and running and gain access to their apps for them. There is this code that flips through images for World History class. I have removed the code from the page but the page still does not function.
3
1923
by: Wade | last post by:
08242005 1416 GMT-5 Recently some of you helped me with a script to change images. Well I was asked to make a change to the script and not knowing if what the school system is even possible, Ill ask you all. The script just loads some images and roates through them. However, the school wants to be able to put more and more pictures in the folder and the script pull all the images for rotation.
6
9481
by: John Ortt | last post by:
Hi there everyone, I have a part info form which has a faded image of our company logo as a background. I want to replace the faded image with a bright red warning image on items which have run out of purchasing cover. I am nearly there, the only problem is that the code below only changes the image background for text and combo-box backgrounds, it doesn't apply it to the whole form.
4
3484
by: Doug van Vianen | last post by:
Hi, I have the following coding on a web page. It causes two pictures (pic1.jpg and pic2.jpg) to show, one above the other and then when one clicks on the top picture is squeezes to the left (as its width is reduced) to show the bottom picture. Then when the bottom picture is clicked the top picture expands to the right to cover the bottom picture again.
2
3120
by: austinra | last post by:
i have a splash screen that i want to change a picture once a second for three seconds; then load my main form. what i want it to do is load a picture into a picture box; start a timer which will stop the loop for one second then start the loop again add 1 to the pintcount which will result in the name of aneither picture (my pictures are named 1, 2, 3) i have it in the form load event procedure. this is the code that i have so far. what i have...
10
1805
by: Anthony | last post by:
I am using the following code to display fading pictures on a team website. Can someone show me how to modify it such that I can display the names of each employee when the picture changes? This is not the complete code for the page but only the code relevant to what I am asking here. Some background information for you: the page is set up using a layout table and the pictures are displayed in a layout cell.I appreciate any help. ...
0
1190
by: hanisimo | last post by:
I am trying to write a small program to replace pictures in PowerPoint presentation... To find the pictures, I check Shape Type (Shape.Type = msoPicture)... But the problem is: how can I change the picture after this step? What is the method I should use to load the new picture from file to the Shape? Best regards and have a nice day,
1
1606
by: larystoy | last post by:
Newbie to VB6, comfortable with HTML, MS Access so I ain't totally stupid. Maybe just dumb. Am writing a Biblical Quiz program where I need to change a picture and midi sound file each time a user advances to a new question. Have played with several routines but none seem to do what I want. The following will show the first picture, on click shows the second picture, on the next click shows the third picture. Each click thereafter...
0
8826
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9534
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8239
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6793
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.