Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > newbie problem trying to correctly pop up images

Reply
Thread Tools

newbie problem trying to correctly pop up images

 
 
Terry Liittschwager
Guest
Posts: n/a
 
      05-29-2007
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,he ight=395,resizable=1');}
}

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

The link references are like:

<a href="javascriptopitup('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.
 
Reply With Quote
 
 
 
 
Terry Liittschwager
Guest
Posts: n/a
 
      05-30-2007
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,he ight=557,resizable=1');}
}

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

with the individual calls like:

<a href="javascriptopitup('images_v/eweb1.jpg','width=520,
height=352,resizable=1')">first</a>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IE 8 Pop-out menus not displaying correctly in IE 8 Soung ASP .Net Web Controls 0 08-24-2009 11:42 PM
Is my site working correctly? Trying to get a census. yerk5 HTML 2 07-23-2008 10:27 PM
Trying to use rename(); correctly. Merlin C Programming 8 02-06-2006 02:55 AM
pop up prevention problem; for wanted pop ups joe doe Firefox 2 03-03-2005 08:08 AM
how to pop an exit console correctly John Hoge Javascript 2 05-26-2004 12:40 PM



Advertisments