070823 updated a [Message prompt Box] component compatible with ie7_javascript skills

Source: Internet
Author: User
070823 the updated [Message prompt Box] component is compatible with ie7. Tip: 8.23 fixed the bug of ie 7 Display Error. Please download it again. Sorry for this!

Update description:

1. Fixed the incorrect button text in IE7.0. (The download source code has been updated. Please download it again ).
2. modified some js Code. (The height of the pop-up box is calculated only during initialization)


1. completed the component introduction. I didn't write 5-7 introductions, and some friends didn't even notice it. Add it here!

========================================================== ====================
Some time ago, the company needed to write a small component to replace the default gray messaging component (alert/Confirm) of windows. Because the system developed by the company is mainly for IE browsers, therefore, the code that started to run in ff is invalid. Today, we plan to share the Code. In order to minimize the impact of bricks, we spent nearly an hour modifying the code compatibility, currently, it runs normally in ie6.0 and FF2.0, and other browsers are not tested. The company is working on the task, so it is too lazy to spend a lot of time completing the task to meet most of the requirements.

Component introduction:
1. The call method is re-loaded. Now it is written as a class, and then the call method is converted into several simple method calls. No new call is required. The call method is clear and simple.
2. compatible with IE6.0 & FF2.0.
3. Currently, three types of skin are available: Vista, QQ, ExtBlue, and BlackColl. If you are interested, you can modify the style sheet file to define a new skin.
4. Four message types are provided. They are message prompts, success messages, error messages, and inquiry messages.
5. When a message box is displayed, operations on other elements on the page are blocked. select and select under iframe are automatically hidden, and iframe and other elements are masked.
6. The select control remains in the original state when the status of the page is restored. That is, if the select control is hidden, the select control remains hidden after the message box pops up and is disabled, only the previously displayed select is displayed.
7. When the message component pops up, the operation on the keyboard Tab and Space key is blocked (to prevent keyboard operation page elements). Press Enter as the "OK" button of the message component.


Introduction:
1. First introduce ymPrompt. js on the page.
2. Call the required message function:
(1) Alert (content, width, height, title, okFunc, cancelFunc) // Message Type
(2) SucceedInfo (...) // successful information type
(3) ErrorInfo (...) // error message type
(4) ConfirmInfo (...) // query the Message Type

The parameters of the four methods are identical:

Content: The content to be displayed by the message component.
Width: the width of the message box. If this parameter is not set, set null to adaptive width.
Height: the height of the message box. If this parameter is not set, set it to null. The height is adaptive.
Title: Message component title
OkFunc: name of the function executed when you click OK.
CancelFunc: name of the function executed when you click the cancel or close button.

View Demo: http://www.ajaxbbs.net/test/ymPrompt/demo.htm
Note: the reason for the speed of the network space is that opening the demo for the first time may result in slow image loading. Please open the demo and download the image or the source code to view the demo.
Download source code:
Local download

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.