New on DHTMLGoodies.com:
DHTML Chess is now available for WordPress at WordPressChess.com.
Download modal message script
Download files
You can download the entire script from this Zip file.
Files included in the package:
- demo-modal-message.html = Demo file
- js/modal-message.js = Main Javascript file
- js/ajax.js = Ajax (Library from http://twilightuniverse.com/projects/sack)
- js/ajax-dynamic-content.js = JS file from the Ajax dynamic content script.
- css/demos.css = CSS file the demos
- css/modal-message.css = CSS file needed in the script
Configuration
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:
Create object of class DHTML_modalMessage
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:
setSource()
Specify path to external file. The content of this external file will be displayed inside the box. Argument to this method is:
- relative path to file(String)
Example: messageObj.setSource("include/myMessage.html");
setHtmlContent()
Specify static HTML content. Argument to this file is:
- HTML content(String)
Example: messageObj.setHtmlContent("This is <B>My</B> message");
setSize()
Sets the size of the message box. Arguments to method are:
- width(int) - Width of box
- height(int) - Height of box
Example: messageObj.setSize(500,300);
display()
Displays the message box. This method makes the message box appear on the screen. This method doesn't take any arguments.
close()
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
No one has commented this - be first!
Post your comment
Comment preview: