473,397 Members | 1,961 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,397 software developers and data experts.

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="description" content="">
<meta name="keywords" content="">
<meta name="author" content="rd*****@netzero.net">
<meta name="generator" content="AceHTML 5 Freeware">

<script language= "Javascript">

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

function ViewPhoto(filename)
{
photo=window.open(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=ViewPhoto("images/DCP_0287.jpg")><img
src="smpics\DCP_0287sm.jpg"></a>
<a href="#" onclick=ViewPhoto("images/DCP_0245.jpg")><img
src="smpics\DCP_0245sm.jpg"></a>
<a href="#" onclick=ViewPhoto("images/DCP_0289.jpg")><img
src="smpics\DCP_0289sm.jpg"></a>
<a href="#" onclick=ViewPhoto("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 4347
"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(filename)
{
features = "height=425,width=625";

if(photo != null && !photo.closed)
{
photo.close();
}
photo=window.open(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
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...
23
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...
3
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...
6
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...
4
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...
2
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...
10
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...
0
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...
1
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.