Open Tech Support
Open Tech Support Archives
Back to HomeCommunityReviewsGuidesDownloadsTech LinksMarketplaceContact Us
 »  SITE NAVIGATION
»  OTS Home
»  OTS Forums
»  OTS Archives

»  About our site
»  Search our site
»  Support our site

»  What is this site?
»  Who are we?
 
 
 »  ADVERTISMENT
 
  Pages: 1

New Window Height & Width

(Click here to view the original thread with full colors/images)


Posted by: MK

I was testing on my HD and I tried:

<p align="center"><a href="file:///D:/test/A.htm" target="_blank" width="120" height="75">TEST</a></p>

But...I hope that works...good, HTML off...ok, I want to have a link open a new window and be a certain size..so on the FPS Page I have the "Server" link(when I put it up) go to a small window displaying the specs and the ip to the TG HLF server and I wanna be able to do the same thing with the pictures page..anyone know?


------------------
"A Day To Dream. A Lifetime To Act."




Posted by: Scav

http://hotwired.lycos.com/webmonkey...?tw=programming

The info im giving you can be found there as well in more depth.

To open a window of a specific size you have to bring in a tiny bit of javascript but dont worry its easy. Just make it:

<a href="#" onClick="window.open('somewhere.htm','name_of_window','height=75,width=120');"

That should get you started. Remember its important to not use double quotes inside the javascript as you are using them in the onClick and not to put any spaces in the set of information for the window.open command. You can also do stuff like disable or enable scrolling, the location, the navigator options, where you want it to appear, and all sorts of junk but that right there is to get a window of the size you want.



Posted by: MK

Thanks.

------------------
"A Day To Dream. A Lifetime To Act."




Posted by: MK

Do you mean this: I'll do a test with OTS Homepage

<a href="http://www.opentechsupport.net" onClick="window.open(index.htm','OTS Homebase','height=25,width=50');">OTS HomePage</a>

So, that should open the OTS Homepage at a height of 25 and width of 50, correct? Or did I screw up somewhere?


------------------
"A Day To Dream. A Lifetime To Act."




Posted by: Canis Lupus

Test it on your TG FPS server, MK, not on this forum ...

------------------
If you gaze into the abyss... you might fall off the edge...



Posted by: MK

Scav, I tried that, what I wrote, and it didn't work..can you tell me what I did wrong?

------------------
"A Day To Dream. A Lifetime To Act."




Posted by: Canis Lupus

what you did wrong was you forgot to put a single quotation mark before the URL itself...

onClick="window.open(index.htm','OTS Homebase'

Look at index.htm .. see anything missing? http://www.opentechsupport.net/forums/biggrin.gif

------------------
If you gaze into the abyss... you might fall off the edge...



Posted by: MK

Now it's not opening it in another window...sigh http://www.opentechsupport.net/forums/frown.gif I'll look over the code again. Thanks Laggy for spotting that though http://www.opentechsupport.net/forums/tongue.gif

------------------
"A Day To Dream. A Lifetime To Act."




Posted by: MK

whoo, I'm insane now http://www.opentechsupport.net/forums/biggrin.gif

------------------
"A Day To Dream. A Lifetime To Act."




Posted by: Canis Lupus

The reason it's not opening another window is because you forgot to specify a target window.

Read the tutorial carefully and try again. Battle.net wasn't hacked in a day, y'know.

------------------
If you gaze into the abyss... you might fall off the edge...



Posted by: MK

Sweet, ok, thanks..name meaning like _blank or _top...Ok, thanks guys. Ok, I got that part figured out, re-read the tutorial. But even in the tutorial's examples, when you click the link to make a new window, the main page has to change also, such as change into another page or change into itself again...Is there a way just to make the link open a little window and not change the main page itself? I didn't see anything about this in the tutorial...

------------------
"A Day To Dream. A Lifetime To Act."




Posted by: Scav

Id love to help you out man but you make it tough with words, to make it work without opening anouther window use "#" for the href of the link

<a href="#" onClick="window.open('somewhere.htm','_new','height=100,width=100');">Link</a>

whenever you want a link to not go anywhere make the url the # sign

if you have more problems include a link to what yer working with so i can check it out there.



Posted by: MK

Sweet, that # fixed it, thanks http://www.opentechsupport.net/forums/biggrin.gif

------------------
"A Day To Dream. A Lifetime To Act."




Posted by: MK

Except, it still goes somewhere, # just makes it load the same page....

------------------
"A Day To Dream. A Lifetime To Act."




Posted by: Scav

gimme a url it shoulnt go anywhere, it should just search the page for the whole page. sounds goofy buts its like those links that send you farther down the page, they dont reload it it just centers yer screen on the #name, cept with just plain # yer telling it to center it nowhere so nothing happens.



Posted by: MK

Now it works http://www.opentechsupport.net/forums/biggrin.gif Thanks..I'm testing it with 'Counter-Strike' on the Screenshots section of the TG FPS Page. http://www.the-group.org/vip/fps/screens.htm

------------------
"A Day To Dream. A Lifetime To Act."




 
Copyright 2000-2008 Open Tech Support.  All Rights Reserved.  Site Design and Development by Tolitz Rosel.