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

Can you close a slideshow window with javascript?

1
Hi, I'm not very experienced at using javascript, so if there is a better way of doing this than using js feel free to suggest it.

Where I am:
I've got a pop up slideshow, where people click normal image links to go back and forward through it.

What I want to do:
I want an image link that closes the window when clicked, so people can go back to the main site. I want an image rather than a form button as then I can make it the same as the forward and back buttons.

The problem:
When I use this code:
Expand|Select|Wrap|Line Numbers
  1. <a href="javascript: window.close()"><img src="image.gif"></a>
it only closes if it is the first window opened, not in any of the ones linked to after this.

I want it to work in all browsers, including Safari

any ideas gratefully received, also if it just can't be done, could you let me know.

(PS, I've also tried to make the image link to another page with an automatic timeout that didn't work either.
Expand|Select|Wrap|Line Numbers
  1. <body onLoad="setTimeout('window.close()', 1000);">
Works on it's own, but not when linked to)
Sep 22 '07 #1
2 1384
pbmods
5,821 Expert 4TB
Heya, Ana. Welcome to TSDN!

Please use CODE tags when posting source code:

[CODE=html]
HTML code goes here.
[/CODE]
Sep 23 '07 #2
acoder
16,027 Expert Mod 8TB
Try:
[HTML]<img src="image.gif" onclick="self.close();">[/HTML]
Sep 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jeannie | last post by:
I have a popup window which is a slideshow of about 7 images. When the popup window loads, the first image is present and then the viewer can select next or previous to scroll through the rest of...
8
by: drillbit_99 | last post by:
I have an HTML page of thumbnail images. Each image can begin a slideshow of the images on the page by clicking on the image. This opens another HTML page that begins the slideshow using large...
22
by: bevoldjling | last post by:
Hi ! I need some help in putting together a website for our family gathering. Although I'm still pretty "green", I don't think what I need requires terribly advanced skills ...except for one...
3
by: eligius | last post by:
Found this neat slideshow javascript with linked images. Is it at all possible to change the properties (height, with, etc.) of the opened window of every individual link? <script...
6
by: mrtaka79 | last post by:
Okay, first of all, I'm a complete noob, so go easy on me. I have this code that works perfectly for me. The only thing I want to add is to randomize the pictures/links that show up. Can anyone...
1
by: ttamilvanan81 | last post by:
Hai everyone, I need to provide the slideshow for the images. I have upload the images into database. Then i will retrive all the images from the database and provide the slideshow for those...
2
helimeef
by: helimeef | last post by:
Hiya, I'm upgrading a this slideshow to Object Oriented code (so I can reuse it for other clients), and I'm having some problems getting the library to work. Here is what it's like so far:...
3
by: Gaby Sandoval | last post by:
I have a very simple javascript slideshow. It is extremely basic (see small sample below): <script language="JavaScript1.1"> <!-- //specify interval between slide (in mili seconds) var...
1
by: maarten2002 | last post by:
Hi people, I am quite new to JS-scripting and I have a question. Finally I found a "good" slideshow which works in IE, Chrome, FF with prototype. The only thing is that I would like the...
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...
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
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
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...
0
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...

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.