newbie problem trying to correctly pop up images

Discussion in 'Javascript' started by Terry Liittschwager, May 29, 2007.

  1. I've set up a small website www.mckenzieriverproblems.org to help
    resolve a problem my wife and I are having, but I can't pop up images
    entirely correctly. For example, in the third paragraph of the
    initial page, I have four links to images. If I click on any one of
    them, the appropriate image comes up, and I can click on the other
    successively and they will work as long as I don't dismiss the popup
    window. However, if I dismiss the popup window, then clicking on any
    of the links produces nothing.

    The script I'm using, copied from another site, is:

    var newwindow = ''
    function popitup(url) {
    if (newwindow.location && !newwindow.closed) {
    newwindow.location.href = url;
    newwindow.focus(); }
    else {
    newwindow=window.open(url,'htmlname','width=520,height=395,resizable=1');}
    }

    function tidy() {
    if (newwindow.location && !newwindow.closed) {
    newwindow.close(); }
    }

    The link references are like:

    <a href="javascript:popitup('images_v/eweb1.jpg')">first</a>

    Interestingly, everything works right if I run the site off my local
    computer files.

    Any and all comments or suggestions are welcome.

    Terry L.
    Terry Liittschwager, May 29, 2007
    #1
    1. Advertising

  2. Hmm, the problem resolved itself when I was tinkering with the script
    trying to fix it so that the window size better matched the images.

    Thus the following works as I intended:

    var newwindow = ''
    function popitup(url) {
    if (newwindow.location && !newwindow.closed) {
    newwindow.location.href = url;
    newwindow.focus(); }
    else {

    newwindow=window.open(url,'htmlname','width=520,height=557,resizable=1');}
    }

    function tidy() {
    if (newwindow.location && !newwindow.closed) {
    newwindow.close(); }
    }

    with the individual calls like:

    <a href="javascript:popitup('images_v/eweb1.jpg','width=520,
    height=352,resizable=1')">first</a>
    Terry Liittschwager, May 30, 2007
    #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. Replies:
    2
    Views:
    8,515
    Randy Webb
    Feb 4, 2006
  2. Bone Ur
    Replies:
    4
    Views:
    381
    Bone Ur
    Dec 19, 2007
  3. Chris Davoli

    Tool Tip pop up - pop up time is too short

    Chris Davoli, Feb 24, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    462
    Lee Atkinson
    Feb 24, 2009
  4. Soung

    IE 8 Pop-out menus not displaying correctly in IE 8

    Soung, Aug 25, 2009, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    832
    Soung
    Aug 25, 2009
  5. John Hoge

    how to pop an exit console correctly

    John Hoge, May 25, 2004, in forum: Javascript
    Replies:
    2
    Views:
    85
    kaeli
    May 26, 2004
Loading...

Share This Page