-
Can I open windows of different sizes with one script?
Hallo
Utter Java newbie here, so this may be a silly question, I don't know.
I have the following script, which opens a new window of a certain size. Is it possible to put variables in for height and width, so I can open windows of several different sizes with the same script? In which case, how? (And how do I call it?)
Thanks
-----
<script language='javascript'>
//-- This function opens the new, empty window named floater.
function openWindow(url) {
winStats='toolbar=no,location=no,directories=no,menubar=no,'
winStats+='scrollbars=yes,width=400,height=400'
if (navigator.appName.indexOf("Microsoft")>=0) {
winStats+=',left=10,top=10'
}else{
winStats+=',screenX=10,screenY=10'
}
floater=window.open(url,"",winStats)
}
//-->
</script>
-
I've got a reply from another forum, but I thought I'd post it here, in case anyone else wants to know how to do this:
<script language='javascript' type="text/javascript">
//-- this function opens the new, empty window named floater
function openWindow(url,iW,iH) {
winStats='toolbar=no,location=no,directories=no,menubar=no,'
winStats+='scrollbars=yes,width=' + iW + ',height=' + iH
if (navigator.appName.indexOf("Microsoft")>=0) {
winStats+=',left=10,top=10'
}else{
winStats+=',screenX=10,screenY=10'
}
floater=window.open(url,"",winStats)
}
//-->
</script>
to call it:
<a href="javascript penWindow('http://www.blahblahblah.com/html',400,400);">link</a>
[NB. = colon, little o]
Similar Threads
-
By Jeff Jones in forum Open Source
Replies: 6
Last Post: 07-11-2002, 10:37 AM
-
By Aditya Sanghi in forum VB Classic
Replies: 0
Last Post: 04-29-2002, 07:43 AM
-
By Dennis in forum Architecture and Design
Replies: 44
Last Post: 08-23-2001, 07:09 AM
-
By Dennis in forum VB Classic
Replies: 10
Last Post: 02-15-2001, 03:52 AM
-
By Toni Bisson in forum VB Classic
Replies: 8
Last Post: 01-19-2001, 05:50 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks