FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How do you create a window without any toolbars?





dwcnps
How do you create a window without any toolbars?

I am asking this question so I can put my game in an HTML document without toolbars.

Thankyou...
erlendhg
You can use this script:

Quote:

<script language="JavaScript">
window.open('Url here', 'Title here', '')
</script>


This has all the options:

Quote:
<script language="JavaScript">
window.open('Url Here', 'Title Here', 'toolbar,menubar,scrollbars,resizable,directories,status,location,copyhistory,fullscreen,width=width,height=height,')
</script>


So if you want a resizable window with the height 400 and width 300 with only a statusbar, that shows index4.html and has the tile "My Window", the code will be the following:

Quote:
<script language="JavaScript">
window.open('index4.html', 'My Window', 'resizable,status,width=400,height=300,')
</script>


Opps. I just discovered that title is not the titlebar text, but the target to the window, and therefore you can't have spaces in the name. So the the example over is invalid, but this one is not:

Quote:
<script language="JavaScript">
window.open('index4.html', 'MyWindow', 'resizable,status,width=400,height=300,')
</script>
dwcnps
Thanks erlendhg,
<EDIT="delete comment">
By the way, which tag do you put it under?
erlendhg
I think you can put it under both <body> and <head>, but I assume the most natural would be the <head> tag Very Happy

--EDIT--

You can also use this script on a link:

Code:
<a href="#" onClick="window.open('Url here', 'MyWindow', 'resizable,status,width=400,height=300')">Link</a>


Here you have the whole script in the <a> tag.

Code:
<script>
function newwin(url) {
window.open(url, 'MyWindow', 'resizable,status,width=400,height=300');
}
</script>
<a href="#" onClick="newwin('Url here')">Link</a>


Here we have made a function where you send in the variable 'url' as the url in the script and the <a> tag calls up the function with 'Url here' as the url.
Place the <script> in <head>, and <a> in <body>.

Code:
<script>
function newwin() {
window.open('Url here', 'MyWindow', 'resizable,status,width=400,height=300');
}
</script>
<a href="#" onClick="newwin()">Link</a>


And here, all the parametres in the script are in the <script> tag, and <a> calls up the function with no variables passing in.
dwcnps
Thanks again... Razz
Related topics
Some questions
Cool Game Making Software !!!
God has ordered you to kill
How do I customize the target="blank" stuff...?
Prevent my website from being downloaded
Shouldn´t I use frames?
Can frames be a good choice? What then?
meebo.com
Firefox...what's the big deal? please enlighten me!
Mac or Windows -- the cool vs. the shizznik
[resolved] subdomains
DreamWeaver
What softwares are good for biulding a webpage?
Which free e-mail service do you prefer?
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.