newbie problem trying to correctly pop up images

  • Thread starter Terry Liittschwager
  • Start date
T

Terry Liittschwager

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.
 
T

Terry Liittschwager

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>
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top