JS pop up conundrum

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 - 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’)”);
}
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

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

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 :slight_smile:

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’)”);
}

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