473,511 Members | 14,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with different thumbnails opening same window

hi, lately i've been working on a website and i have used a bit of
javascript although i'm not an expert in this mather.
On the page there are 3 thumbnails and when you click on a thumbnail a
window with a picture (and text) on it opens.
Each thumbnail should open a window with a different picture. So this is
where the problem comes in : no matter wich thumbnail I click on, it's
always the same window with the same picture that opens...
Does it has something to do with the name of each window or the
showWindow() -function or the .....
the url is http://users.pandora.be/zwerfwagen/test.html
a second problem is the following : when you click on a thumbnail and the
new window opens, it is centered on the screen, but this is only for the
resolution of my screen. how can i make sure that the window is always
centered, no matter what type of screen/resolution is used?

any help would be appreciated
Danny
Jul 23 '05 #1
1 1458
"Danny" <AN********************@pandora.be> wrote in message news:<4U***********************@phobos.telenet-ops.be>...
hi, lately i've been working on a website and i have used a bit of
javascript although i'm not an expert in this mather.
You need to go to the library or bookstore and get a book on
Javascript. The book recommended by this group is: javascript: The
Deinitive Guide by David Flanagan.

For a more basic book, I would consider: HTML for the World Wide Web
with XHTML and CSS: Visual QuickStart Guide, Fifth Edition by
Elizabeth Castro. This book is in the style of a cookbook. This is
good if it has what you want, but bad if not.

You need to abandoned the user of Front Page. It isn't compatible
with Javascript nor with browser other than IE. Front Page will kind
of work but you will get burnt by it eventually.

I could not exacly determine how you wanted your script to work but
here is something that may help.

I posted an example using frames here:

http://groups.google.com/groups?q=rc...gle.com&rnum=6

It has the subject of Re: change image in another frame.
Here is an example using CSS:

Robert

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Swap images</title>
<style type="text/css">

#thumbs{
float: left;
width: 20%;
padding-left: 5px;
padding-bottom: 20px;
}

#picture{
visibility: hidden;
float: right;
width: 74%;
padding-bottom: 20px;
border-width: medium;
border-style: dotted;
border-color: red;
background-color: grey;

}

#footer{
clear: both;
padding-left: 20px;
padding-right: 20px;
padding-top: 5px;
padding-bottom: 5px;
background: #eee;
}

</style>

<script type="text/javascript">
var nasaPath = "http://spaceplace.nasa.gov" +
"/en/educators/images/solarsystem/";

/*
An easier way to do this would be to make a transparent gif
image. Using a transparent gif image would avoid the use
of the css hidden visibility.

Netscape waits until the image is complete to display the new
image. In the meantime, Netscape displays the old image.
*/

var hideFirstPicture = "hidden";

function genImage(link)
{
var data = "<a href='" + nasaPath + link + "_L.jpg'>\n" +
"<img src='" + nasaPath + link + "_T.jpg'\n" +
"onclick='return changeImg(\"" +
nasaPath + link + "_L.jpg\");'>\n" +
"<\/a>";
document.writeln(data);
document.writeln("<br><br>");
}

function changeImg(name)
{

document.getElementById("picture").style.visibilit y = "hidden";
document.images["big_image"].src = name;

return false;

}
</script>
</head>
<body>
<div id="thumbs">
<h3>Solar System:</h3>
<script type="text/javascript">
genImage("Apollo17_Earth");
genImage("clem_full_moon");
genImage("giotto_halley");
</script>
</div>

<div id="picture">
<img id="big_image"
onload = "document.getElementById('picture').style.visibili ty =
hideFirstPicture;
hideFirstPicture = 'visible';"
src=
"http://spaceplace.jpl.nasa.gov/en/_images/common/nasa_header/logo_nasa.gif"

<p>This is the larger picture</p>
</div>
<div id="footer">
<p>These image are from NASA. See:<br>
http://spaceplace.jpl.nasa.gov/en/ed...s_images.shtml
</p>
</div>
</body>
</html>
Jul 23 '05 #2

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

Similar topics

1
1788
by: Markus Seibold | last post by:
Hello NG, i have a picture galerie with thumbnails. I want to add JS functionality that opens a new window with an enlarged version of the image when the user clicks on the thumbnails picture....
1
3578
by: Jiri Brada | last post by:
Hi, I have got a following problem with using Javascript: I have a HTML page with pictures' thumbnails. After clicking on any thumbnail, I would like to open a new window with the original...
10
6708
by: David McCulloch | last post by:
The following code opens a new window, but the "resizeTo" doesn't resize it. Why not? (Don't ask why I simply did not open the window with the new size....my original problem was how to open a...
8
7050
by: Rut | last post by:
Does anyone know how to start powerpoint from vb.net without the ppt screen appearing. I want to keep it hidden? Using this code: Try pp = New PowerPoint.Application pp.Visible =...
0
1159
by: Aryan | last post by:
Hi, I am doing "Export to Excel" functionality, but while doing this I am getting error. Like I have two types of Report, each type has many sub reports inside. So I am opening new window for Each...
0
1182
by: Aryan | last post by:
Hi, I am doing "Export to Excel" functionality, but while doing this I am getting error. Like I have two types of Report, each type has many sub reports inside. So I am opening new window for Each...
2
2851
by: Mux | last post by:
I am facing the following problem while exporting data to Word. The current implementation is as described below: I have a JSP file which has a link that enables you to export the data to Word....
1
2362
by: sneeka2 | last post by:
Hi, I'm developing a portfolio site, which contains a bunch of thumbnails wrapped in links: <a href="..."><img ... /></a>. A window.onload script inserts an onclick property into the links which...
7
3944
by: SHC | last post by:
I'm in need of some javascript to load two pages into two seperate iframes which are on two seperate and different pages. Rather complicated I know (and easier done in one frameset), but caused...
0
7349
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,...
1
7074
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
7506
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
5659
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,...
1
5063
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...
0
3219
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...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
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...

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.