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

Discussion in 'Javascript' started by PWalker, Feb 24, 2005.

  1. PWalker

    PWalker Guest

    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
    PWalker, Feb 24, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:421dc27d$...
    > 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
    >
    >
    David Lionetti, Feb 24, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raj
    Replies:
    3
    Views:
    12,928
    gautamkhosla29
    Jun 11, 2009
  2. David Lozzi
    Replies:
    1
    Views:
    493
    john smith
    Feb 1, 2006
  3. Joshua Beall
    Replies:
    26
    Views:
    220,272
    AndreiKaa
    Jun 29, 2007
  4. vseshan204
    Replies:
    3
    Views:
    3,602
    Vangi
    Jul 27, 2009
  5. Cramer
    Replies:
    2
    Views:
    107
    David Mark
    Dec 11, 2007
Loading...

Share This Page