 |
Javascript How-To Ask your "How do I do this with Javascript?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

September 6th, 2004, 07:38 PM
|
Registered User
|
|
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Starting a fixed size browser window
Hi
Im currently making some product videos at work, and as a simple method of showing these via a CD I want to have an Autorun html page that will have links to the various mpgs. My company doesn't want to get any additional software so this is the best way I can think of. To make it look less like a browser I'd like to start a fixed sized window with only the close x in the top right hand corner, so the user is not really aware that it is running through a web browser. I know how to create pop ups that will be of a certain size, and without any control features, but is it possible to start a browser in this way?
Thanks in advance if you can help.
Regards
Loz
|

September 7th, 2004, 02:15 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
Only really possible if you use a stand-alone script (i.e. one not embedded in a web page) to start the browser. If you know what browser the person is using it's easier, below is a quick sample for IE, Netscape also has COM class that acts similarly but I don't have an example. You'll need to save this to a file named "startIe. js" and set it to start up in the autoRun.inf on the CD. You may also have to work out the path to the first page
Code:
var INITIAL_PAGE = "file:///f:\\startpage.htm" //path to first page goes here
var READYSTATE_COMPLETE = 4;
var oIe = new ActiveXObject("InternetExplorer.Application");
oIe.Width = 600; //Pixels
oIe.Height = 400;
oIe.AddressBar = false;
oIe.RegisterAsDropTarget = false;
//Add more styling code here
oIe.navigate(INITIAL_PAGE);
while (oIe.ReadyState != READYSTATE_COMPLETE)
{
WScript.sleep(200);
}
oIe.visible = true;
For more stuff on IE look at IWebBrowser2 on http://msdn.com/
--
Joe
|

September 7th, 2004, 09:20 AM
|
Registered User
|
|
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Joe
I'll have a go with that.
Regards
Loz
|

September 21st, 2004, 04:17 PM
|
Registered User
|
|
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
good stuff:D
Pay attention to me boy, I'm not talkin' just to hear my head roar.
|

April 3rd, 2006, 12:43 PM
|
Registered User
|
|
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello, I have a problem, I want to set a browser windows as a fixed size. I don't want to make a pop up but just open my index.html in a fixed size. !! How I can do that?
Thanks,
Math
|

April 3rd, 2006, 01:33 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
> Hello, I have a problem, I want to set a browser windows as a fixed size.
I strongly advise against that. Why do you have to change the size of the window? If it's design, look into liquid layout. It's fairly trivial to create a liquid design with modern web standards that scales to the user's screen resolution and font preferences.
Adjust to the user, don't expect the user to adjust to you, it's a battle you'll never win.
Having said that, for educational purposes, you use the following JavaScript to resize a window. This sort of control can be disabled by the user, and probably is disabled anyway if it isn't used on a popup window.
Code:
<script type='text/javascript'>
window.resizeTo(x, y);
</script>
Replace "x" and "y" with the numerical dimensions.
Regards,
Rich
--
[ http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
|

April 4th, 2006, 08:16 AM
|
Registered User
|
|
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks I'm very happy! I will try it right now! thanks:)
Math
|

April 4th, 2006, 08:23 AM
|
Registered User
|
|
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi It's me again !! Thanks it's work very well !! SO I have one more interrogation! It's possible to enable (turn off) the vertical scrool Bar ??
Math
|

April 4th, 2006, 08:37 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
> SO I have one more interrogation! It's possible to enable (turn off) the vertical scrool Bar ??
Sure, you'd do that with CSS.
Code:
<head>
<style type='text/css'>
body, html {
overflow: hidden;
}
</style>
</head>
<body>
If that doesn't work, try this:
Code:
<head>
<style type='text/css'>
body, html {
margin: 0;
padding: 0;
height: 100%;
}
div#wrapper {
height: 100%;
overflow: hidden;
}
</style>
</head>
<body>
<div id='wrapper'>
</div>
</body>
</html>
HTH!
Regards,
Rich
--
[ http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design
|

April 4th, 2006, 12:56 PM
|
Registered User
|
|
Join Date: Apr 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
OKey the first one script work well but, I only want to enable(turn off) the Vertical one not the horozontal one !! It's possible to only show the horizontal scrolling bar?
Thanks,
Math
|
|
 |