PDA

View Full Version : Pop up issues.


PCheese
09-17-2001, 08:55 AM
I'm trying to code a pop up window. Usually not a problem. Only this one has to have a status bar so that users can see it is secure. (Not reassuring enough unless they see the little padlock).

Try as I might I can't get it to pop up with a status bar. Can anyone edit the code to help little old me? Purlease?

<script language ="javascript">
function pop_up(h,w,where){

var winX = (screen.width/2)-(w/2);
var winY = (screen.height/2)-(h/2);

size="height=" + h + ", width=" + w + ",top=" + winY + ", left=" + winX;
win = window.open(where, "dep", size, hotkeys="no");
}
</script>

Thanks in advance - also - if you can make it so that you can't min/max it too that would be great.

PCheese.

P.S. I've tried sizable="no" and status="yes" but I'm not sure I've got them right...

P.P.S. There's a shiny red apple for the kiddy who gets it right.

whkoh
09-17-2001, 09:11 AM
Check http://www.dynamicdrive.com/ they have a similar script.

PCheese
09-17-2001, 09:32 AM
Hmm, I've had a look about on DynamicDrive (very nice site) but I still can't get it to work. I'm using IE5 so I don't think it's the browser that's the problem. I think it's something to do with this line :

win = window.open(where, "dep", size, hotkeys="no", sizable="no", status="yes");

Oh, woe is me.

pixelmonkey
09-17-2001, 10:24 AM
try something like this...

"resizeable=no, scrollbars=no, status=true, width=600, height=400"

i belive when defining the size to /2 of the viewers browser you cant make the window nonresizeable. best bet would be 600 x 400 that will cover everyones browser settings.

let me know if it works!
chris<pixelmonkey>:monkey:

if it doenst , i know Doc can help you!

PCheese
09-17-2001, 10:47 AM
Monkey, Whkoh, Thanks.

I've cracked it, after a few minutes of sobbing and one intense gurgle of displeasure. The status=true didn't work and status=yes didn't work but status=1 works.

It's because I'm building the string in seperate places and it was interpolating the "quote marks" around the "yes" as part of the string - and it didn't like it without because it kept saying string(yes) is unrecognised.

Thanks guys.

But I don't have an apple.