|
-
Senior Member
Q10. How can I make my windows open the correct size on a Mac?
A. Use a piece of JavaScript to adjust the window size for different platfoms.
--Adjust the sizes and window attributes to your taste--
Put this in the Head of your html document:
function platformCheck(){
if (navigator.platform == "Win32"){
window.open('mypage.htm','pagename','toolbar=yes,s crollbars=no,status=yes,width=800,height=600')
} else {
window.open('mypage.htm','pagename','toolbar=yes,s crollbars=no,status=yes,width=785,height=587')
}
}
You can then call the function from somewhere in your html; for example an image that says "Go to Flash site" would have the code placed in it's tag:
< img src="image.jpg" onclick="platformCheck();" alt="Go to Flash site" >< / img >
Or you could resize a window as it loads, using this function in the head of the document:
function resizeMe() {
if (navigator.platform == "Win32"){
self.resizeTo(800,600)
} else {
self.resizeTo(785,587)
}
}
And then in the Body tag of the page:
< Body onload="resizeMe();" >
[Javascript 1.2 or higher is required for this (that's version 4+ browsers, it should work but JavaScript is a really non-cross-browser thing...) so don't rely on it too much, the weird spacing of the tags is to stop them being parsed by the board] - SJT
[SJT]
Sam

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
|
Click Here to Expand Forum to Full Width
|