Closed Thread Icon

Preserved Topic: Position of Pop-up Window Pages that link to <a href="https://ozoneasylum.com/backlink?for=18032" title="Pages that link to Preserved Topic: Position of Pop-up Window" rel="nofollow" >Preserved Topic: Position of Pop-up Window\

 
Author Thread
PixelHazard
Obsessive-Compulsive (I) Inmate

From: Tampa, FL USA
Insane since: Mar 2001

posted posted 07-07-2001 18:56

Hi... <--I'm a newbie, so don't laugh!

I'm working on a project for my advanced photoshop class. I have to make a gallery, now my main page is already very big, because i made 10 projects and but them on layers. I would like to have a link that will open a new window, now here is the question....is it possible, with the help of javascript to force the position of the pop up window on the screen, and what you can see in the toolbar (i don't need any buttons on top, or even a title bar)

If anyone has an answer to this, please help. I would need the whole script, because i know very very very little about javascript at this time........

Oh, on a sidenote, is it possible to open the CD-Rom door by linking a script to a text link or graphic?

Thanks

Tom"EvilEgg"

kretsminky
Maniac (V) Inmate

From: A little lower... lower... ahhhhhh, thats the spot
Insane since: Jun 2000

posted posted 07-07-2001 18:59

Opening the CD drive? Do I sense some tomfoolery going on here? Possibly some chicanery?



PixelHazard
Obsessive-Compulsive (I) Inmate

From: Tampa, FL USA
Insane since: Mar 2001

posted posted 07-07-2001 19:04

Well i was gonna put something like "Thanks for stoping by, have a free cup holder!" Then when they click the link, it opens their CD-ROM Drive.

I gues the script would have to got thru several drive letters, from D: to H: to be safe.

Tom"EvilEgg"

"Eggs will take over the world some day! Either that or will start to stink really bad. Viva le eggolution"

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 07-07-2001 19:13

This is a JavaScript that I wrote on January 1, 2001 (you can find it in the Asylum archives). It will center pop-up window on screen...

--- start copy/paste from archives ---

// Written by mr.maX, http://www.max.co.yu/
function _window(fileURL, windowName, winWidth, winHeight) {
var top = (screen.availheight - winHeight)/2;
var left = (screen.availwidth - winWidth)/2;
newWin = window.open(fileURL, windowName, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+winWidth+",height="+winHeight+",left="+left+",top="+top);
newWin.moveTo(left, top);
}

And simply call it like this:

<A HREF="javascript:_window('bla.html', 'myWin', 640, 480);">GO! GO! GO!</A>

Also, there's one more issue with popup windows... You've maybe noticed that when you launch popup window and after that switch back to some othe window leaving popup window open when you try to open it again by clicking on the link it won't appear on top other windows, and some poeple won't realize what's happening (they often forget to look at the taskbar). Anyway, there's a solution for this, too. Simply modify the <BODY> tag of all pages that pop-up to look something like this:

<BODY ONLOAD="this.focus()">

That should be all...

--- end copy/paste from archives ---

Now, as far as opening CD is concerned, you can't do that with JavaScript.



[This message has been edited by mr.maX (edited 07-07-2001).]

PixelHazard
Obsessive-Compulsive (I) Inmate

From: Tampa, FL USA
Insane since: Mar 2001

posted posted 07-07-2001 19:33

thanks <8-)




« BackwardsOnwards »

Show Forum Drop Down Menu