Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 6th, 2004, 07:38 PM
Loz Loz is offline
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


Reply With Quote
  #2 (permalink)  
Old September 7th, 2004, 02:15 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

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
Reply With Quote
  #3 (permalink)  
Old September 7th, 2004, 09:20 AM
Loz Loz is offline
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Joe

I'll have a go with that.

Regards

Loz
Reply With Quote
  #4 (permalink)  
Old September 21st, 2004, 04:17 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mr_goonie
Default

good stuff:D

Pay attention to me boy, I'm not talkin' just to hear my head roar.
Reply With Quote
  #5 (permalink)  
Old April 3rd, 2006, 12:43 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #6 (permalink)  
Old April 3rd, 2006, 01:33 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

> 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
Reply With Quote
  #7 (permalink)  
Old April 4th, 2006, 08:16 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks I'm very happy! I will try it right now! thanks:)

Math

Reply With Quote
  #8 (permalink)  
Old April 4th, 2006, 08:23 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #9 (permalink)  
Old April 4th, 2006, 08:37 AM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

> 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
Reply With Quote
  #10 (permalink)  
Old April 4th, 2006, 12:56 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser window: Specifying the size and location? asearle HTML Code Clinic 2 November 22nd, 2007 08:50 AM
center text (only) in fixed size div, how to do it beetle_jaipur BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 April 16th, 2007 01:38 PM
Fixed size table amc Dreamweaver (all versions) 4 August 29th, 2004 07:03 AM
A fixed size Datagrid pbyrum General .NET 1 July 30th, 2004 09:56 PM
Fonts and Browser window size freaky al Dreamweaver (all versions) 5 October 5th, 2003 11:07 AM



All times are GMT -4. The time now is 06:35 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.