472,119 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

clicking on a thumbnail in a parent window causes parent to reload

Hi, I have several webpages that have around 50+ thumbnail images in it in a
table structure spanning (3 columns) x (17+ rows).

Each thumbnail is wrapped in the following piece of javascript:

<a href="#"
onClick="javascript:window.open('Images/image_name.jpg','window','width=430,height=560,res izable=yes')">

Now since there are so many thumbnails, the page needs to be scrolled to
view the thumbnails at the bottom of the list. When i click on one of these
bottom images, a popup window opens and the enlarged image is displayed
within. Thats ok. But the behaviour im getting is that the parent window
(containing all the thumbnails) is reloaded and defaults to the top of the
page. So I basically have to re-scroll down again to view the next image at
the bottom of the list. This is most annoying.

How can i set this us such that when i press a thumbnail located in the
parent window, the parent window will remain static and not be reloaded and
default to the top of the page.

I do realise that href="#" will reference back to the original page
containing the thumbnails, hence reloading/defaulting to the top again. Is
there any way around this?

Any help most appreciated!

Cheers,
Peter
Jul 23 '05 #1
1 1545
try this:

<a href="#"
onClick="javascript:window.open('Images/image_name.jpg','window','width=430,
height=560,resizable=yes'); return false;">

the return false for the onclick event cancels the normal action for
clicking on a link, which is to follow that link. And I'm not completely
sure about this, and it's not a big deal, but I don't think you need the
"javascript:" before the function call.
"PWalker" <p.******@rad.com> wrote in message
news:42********@dnews.tpgi.com.au... Hi, I have several webpages that have around 50+ thumbnail images in it in a table structure spanning (3 columns) x (17+ rows).

Each thumbnail is wrapped in the following piece of javascript:

<a href="#"
onClick="javascript:window.open('Images/image_name.jpg','window','width=430,
height=560,resizable=yes')">
Now since there are so many thumbnails, the page needs to be scrolled to
view the thumbnails at the bottom of the list. When i click on one of these bottom images, a popup window opens and the enlarged image is displayed
within. Thats ok. But the behaviour im getting is that the parent window
(containing all the thumbnails) is reloaded and defaults to the top of the
page. So I basically have to re-scroll down again to view the next image at the bottom of the list. This is most annoying.

How can i set this us such that when i press a thumbnail located in the
parent window, the parent window will remain static and not be reloaded and default to the top of the page.

I do realise that href="#" will reference back to the original page
containing the thumbnails, hence reloading/defaulting to the top again. Is
there any way around this?

Any help most appreciated!

Cheers,
Peter

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by mkobus | last post: by
7 posts views Thread by Raffi | last post: by
3 posts views Thread by Joe | last post: by
reply views Thread by =?Utf-8?B?UGF1bA==?= | last post: by
2 posts views Thread by =?Utf-8?B?U2lsa0NpdHlGbG9yaWRh?= | last post: by

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.