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

P

PWalker

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
 
D

David Lionetti

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top