Home > Article > Web Front-end > 070823 updated a [message prompt box] component compatible with ie7_javascript skills
Tip: 8.23 has fixed the bug of display error in IE 7. Friends who have downloaded it please download it again. Sorry about that!
Update instructions:
2007-08-23 11:50
1. Fixed the BUG of misaligned button text under IE7.0 (the download source code has been updated, friends who have downloaded it, please download it again) .
2. Modified some js program codes. (The height of the pop-up box is only calculated during initialization)
2007-08-23 21:30
1. Improved the component introduction. Originally, I did not write the three introductions 5-7. Some friends may also Didn't notice. Add it here!
============================================== ==========
Some time ago, the company needed to write a small component to replace the default gray message component (alert/Confirm) of Windows 2000. Since the system developed by the company is mainly for IE browser, so The code at the beginning does not work under FF. I plan to share it today. In order to avoid bricks, I spent nearly an hour modifying the code for compatibility. It currently runs normally under ie6.0 and FF2.0. Other browsers The device has not been tested, and I am busy with company tasks. I am too lazy to spend a lot of time on this. It just meets most needs.
Introduction to the component:
1. The calling method is divided into two parts. Now it is written into a class, and then the calling method is turned into several simple method calls. There is no need to use new when calling. The calling method is clear and simple.
2. Compatible with IE6.0&&FF2.0.
3. Currently, three and four skins are provided, Vista, QQ, ExtBlue and BlackColl. If you are interested, you can modify the style sheet file to define a new skin.
4. Provide four message types. They are message prompts, success information, error information, and query information.
5. When the message box pops up, block the operation of other elements of the page, automatically hide the page select and the select under the iframe (unlimited select hiding), and mask the iframe and other elements.
6. When the page select control state is restored, it remains in its original state, that is, if the original select was hidden, the select will remain hidden after the message box pops up and is closed, and only the originally displayed select will be displayed.
7. When the message component pops up, the operation of the keyboard's Tab key and space bar is blocked (preventing the keyboard from operating page elements). Pressing the Enter key is treated as clicking the "OK" button of the message component.
Usage introduction:
1. First introduce ymPrompt.js into the page.
2. Then call the required message function:
(1)Alert(content,width,height,title,okFunc,cancelFunc) //Message prompt type
(2)SucceedInfo(....) //Success message type
(3)ErrorInfo(...) //Error message type
(4)ConfirmInfo(....) //Query message type
Four methods The parameters are exactly the same:
content: the content to be displayed by the message component.
width: The width of the message box. If not set, please set it to null. The width will be adaptive.
Height: The height of the message box. If not set, please set it to null. The height is adaptive.
title: Message component title
okFunc: The name of the function executed when the OK button is clicked.
CancelFunc: The name of the function executed when the cancel or close button is clicked.
View the demo: http://www.ajaxbbs.net/test/ymPrompt/demo.htm
Note: Due to the speed of network space, the image loading may be slow when opening the demo for the first time, please open it later. The image is downloaded or the source code is downloaded locally to view the demo.
Source code download:
Local download