This script displays a modal message at the center of the screen. All other page controls are disabled until the message is closed. You can choose between displaying static content inside the message box or content from an external file.
This script displays a modal message at the center of your browser window. When this message is displayed, all the other controls on your page will be disabled.
This is how it works…
messageObj = new DHTML_modalMessage(); // We only create one object of this class
Now, you can use some other methods to specify what to show and the appearance of the dialog box. These are some of the important methods:
Specify path to external file. The content of this external file will be displayed inside the box. Argument to this method is:
Example:
messageObj.setSource("include/myMessage.html");
Specify static HTML content. Argument to this file is:
Example:
messageObj.setHtmlContent("This is <strong>My</strong> message");
Sets the size of the message box. Arguments to method are:
Example:
messageObj.setSize(500,300);
Displays the message box. This method makes the message box appear on the screen. This method doesn’t take any arguments.
Hides the message box. This method removes a message box appear from the screen. This method doesn’t take any arguments.
There are also some other methods you can use. Look at the comments above the method in modal-message.js for information about these
Demo: Demo
Download: Download Llink
Resource: http://www.dhtmlgoodies.com/index.html?whichScript=modal-message

Related Listings:
No comments yet.
RSS feed for comments on this post. TrackBack URL