Home arrow HTML arrow Page 2 - Setting the Features of Web Page Dialog Boxes
HTML

Setting the Features of Web Page Dialog Boxes


In this second part of a five-part series on producing web page dialog boxes, you'll learn how to set the text in the status bar of a window, control the size and position of a dialog box, and more. We'll also touch on the content of the dialog box, and how to make it carry out specific tasks when it closes.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
January 05, 2009
TABLE OF CONTENTS:
  1. · Setting the Features of Web Page Dialog Boxes
  2. · Size and Position
  3. · Sending Content to the Dialog Box
  4. · Giving it Body Elements

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Setting the Features of Web Page Dialog Boxes - Size and Position
(Page 2 of 4 )

Size of the Dialog Box

Here I will tell you how to give size to the dialog box and how to resize the dialog box.

To resize, you have to use the specs parameter of the open() method. The following code will produce a window whose width is 400px and whose height is also 400px.


window.open("","","menubar=no,toolbar=no,width=400,height=400","")


Note the ‘width=400’ and ‘height=400’ arguments. You do not have to include the “px” unit designation next to the value.

This size is given when you are opening (creating) the dialog box.

Position of the Dialog Box

When you are creating a new dialog box, you can have its position set. The following code will set the new window at the position (25px, 25px) of the screen.


window.open("","","menubar=no,toolbar=no,width=400,height=400,left=25,top=25","")


The coordinates for position are the left and top coordinates. That is, the left-top corner of the new window is 25px left from the left edge of the screen and 25px down from the top of the screen.


Note the ‘left=25’ and ‘top=25’ arguments. You do not have to include the “px” unit designation next to the value.

Positioning a dialog box can be a good thing, but I usually do not code this. I usually allow the browser to choose a position for me. If you allow the browser to do this for you, it will choose a random position. In practice the random position is usually okay. Occasionally, if the user does not like the position he can drag the window (the title bar) to a position that suits him.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials