473,406 Members | 2,843 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,406 software developers and data experts.

Problem with open enlarged version of an image in a new window

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.
See the following URL for an example:
http://www.faschingsclub-roettenbach...gramm2003.html

What happens with my showLargeImage function now is that whenever I want to
open the first image (could be any of the 22 pictures on the page), the new
window always shows the upper left image (['image1']). The function does not
execute the change of image sources. What can I do about this?

Generally, am I doing this right or is there a better way of implementing
this showlargeImage functionality?

Thanks a lot,
Markus
Jul 20 '05 #1
1 1783
Lee
Markus Seibold said:

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.
See the following URL for an example:
http://www.faschingsclub-roettenbach...gramm2003.html

What happens with my showLargeImage function now is that whenever I want to
open the first image (could be any of the 22 pictures on the page), the new
window always shows the upper left image (['image1']). The function does not
execute the change of image sources. What can I do about this?

Generally, am I doing this right or is there a better way of implementing
this showlargeImage functionality?


The window.open() function returns immediately, before the new window
is actually opened. You're trying to change the source of the <img>
tag before that tag has been created.

It's probably simplest to send the URL of the image to the new window
in the search portion of the window's URL:

window.open('largeImage.html?myimage.gif',...)

and use Javascript code in largeImage.html to change the img source.

Jul 20 '05 #2

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

Similar topics

1
by: Steven Choo | last post by:
Hi all, I have used a script which allows visitors of my personal website to click on a small image to see an enlarged version in a pop-up. It would be great if i could add some text within the...
7
by: Merlin | last post by:
Hi there, I have a serious problem with opening a new window with the help of JavaScript. The problem only occures with Firefox. Once you click on the item which fires up the open function, the...
4
by: VR | last post by:
First, greetings to everyone :) I'm doing a university seminar & I've encountered a problem. I have a gallery with thumbnails linked on pictures. What I want is popup to be opened with...
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
3
by: EnjoyNews | last post by:
I have a popup problem. I have a script that generates a popup for image viewing. It has 2 function, and the first is that it automaticly generates the popup window to the size of the image,...
4
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I open a new window with javascript?...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
13
by: BMc | last post by:
I just want to take a moment to say thank you to so many of you who posted a response to my request for help about the problem with THE GAP (see below?)! Your suggestions were not only a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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.