# JS pop up conundrum

**URL:** <https://forum.kirupa.com/t/js-pop-up-conundrum/4806>\
**Category:** flash\
**Created:** [August 20, 2002, 10:59pm UTC](https://forum.kirupa.com/t/js-pop-up-conundrum/4806 "2002-08-20T22:59:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnonymousCaller](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@AnonymousCaller](https://forum.kirupa.com/u/AnonymousCaller)\
**Post date:** [August 20, 2002, 10:59pm UTC](https://forum.kirupa.com/t/js-pop-up-conundrum/4806/1 "2002-08-20T22:59:12Z")

</div>

Greetings!

I am working on a photo site where the user flips through a virtual portfolio and clicks a button to see larger version of the image. I’m new to JS. I tried working with the JS pop up tutorials here, on Flashkit, and at [Flash-DB.com](http://Flash-DB.com) - and I’m still messing it up. This is actually a two part question [read: “cry for help”]:

1.) My button code is:  
on (release) {  
getURL(“javascript:newWindow(‘[http://www.kevin-lawson.com/new-site/fash/02a.htm](http://www.kevin-lawson.com/new-site/fash/02a.htm)’)”);  
}  
and the HTML code is:  
\<SCRIPT LANGUAGE=JAVASCRIPT  
TYPE=“TEXT/JAVASCRIPT”\>  
function newWindow(big) {  
bigwindow=window.open(big, ‘bigWin’,‘toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,width=560,height=725’)  
}  
\</SCRIPT\>

How do I get the pop up window to pop back on top should the user click on to the button for the next large image pop up window? I tried onFocus(), but obviously was doing somehting wrong.

1. My second question is how can I refer to the JS for two different image sizes? Most of them are (as you can see from the script above) w:560 x h:725, but the landscape orientation is 1120 x 725. How do I make that work?

Any suggestions would be greatly appreciated.

Flash on!  
AC

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2002, 12:28am UTC](https://forum.kirupa.com/t/js-pop-up-conundrum/4806/2 "2002-08-21T00:28:34Z")

</div>

Take a look at the photo albums on my site. If you are interested I will give you the steps you need to take in order to get that type of look.

user- “guest100”  
password- “10000”

(Case Sensitive & without quotes)

[http://cgonline.net](http://cgonline.net)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2002, 1:38am UTC](https://forum.kirupa.com/t/js-pop-up-conundrum/4806/3 "2002-08-21T01:38:41Z")

</div>

I have attached a text file that might be able to help you. I wrote it real quick for someone else a while ago on this board with the same type of questions. To be able to do it in a different size you will have to copy your first function and paste it right under itself, then change the name of the function name and properties of the window.

soyou will have  
\<B\>function NewWindow()\</B\> …and…  
\<B\>function NewWindow2()\</B\> …or whatever you choose to name the second one.

I hope this helps at all 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 21, 2002, 6:15pm UTC](https://forum.kirupa.com/t/js-pop-up-conundrum/4806/4 "2002-08-21T18:15:22Z")

</div>

Many thanks to lostinbeta for the code. Check out Craig’s site. Some great photography.

Just want to document for others what I did. Running w/lostinbeta’s code I modified the JS in the HTLM to:

function newWindow(vert) {  
vertwin = window.open(vert, ‘vertical’, ‘toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=560,height=725,left=0,top=0’)  
vertwin.focus()  
}  
function landscape(horiz) {  
horzwin = window.open(horiz, ‘horizontal’,‘toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=1120,height=725,left=0,top=0’)  
horzwin.focus()  
}

newwindow is the function that opens the vertical window. vertwin tells what action it’s supposed to do: pop up the window with the specified dimensions. horzwin does the same with its own size. the X.focus pops the windows on top.

the action of the buttons was

on (release) {  
getURL(“javascript:landscape(‘[http://www.kevin-lawson.com/new-site/fash/04.htm](http://www.kevin-lawson.com/new-site/fash/04.htm)’)”);  
}

[www.kevin-lawson.com](http://www.kevin-lawson.com) has my first site I built for Kevin. My first stab. This new one should be ready in the next week. BIG pix so 56KB’ers will not enjoy the download time.

Hope this helps the folks helps those new to JS. I know I learned a lot. Thanks again.  
AC
