[Ymprompt message Prompt component]3.1 release

Source: Internet
Author: User
Tags definition transparent color modify net window
New Configuration entry:
New fixpositionParameter setting whether the pop-up box always floats in a fixed position on the screen when the page scrolls.
New DragoutParameter setting allows pop-up boxes to be dragged outside the page range.
New AutoCloseThe parameter setting does not automatically close the pop-up box when the user clicks the button.

exposed properties and method interfaces:

Properties:
version:Current version number such as: Alert (ymprompt.version)
pubdate:The release date of the current version is: alert (ymprompt.pubdate);
CFG:Component's current default configuration

Method:
setdefaultcfg (CFG):Set the default properties of the component, and all pop-up settings are set by default in CFG.
such as: Ymprompt.setdefaultcfg ({maskalpha:0.2,maskalphacolor: ' #00f '}); Set mask layer color to blue, transparency 0.2

getpage ():In the iframe window mode, gets the DOM object to the IFRAME.
such as: Alert (Ymprompt.getpage (). ContentWindow.document.body.outerHTML); Get HTML content for an IFRAME page

Resizewin (w,h):Dynamically modify the size of the window through a program. Parameters: W: width, h: Height
such as: Ymprompt.resizewin (400,300); Modify popup width to 400px and height to 300px

Dohandler (sign,autoclose):Simulates a Click event that triggers a button. Parameter sign: The identity passed to the callback function, AutoClose: Whether the window is closed automatically (by default, global configuration)
such as: Ymprompt.dohandler (' OK ', false); Triggers a click event that determines the button, and does not close the window after the callback function is executed

Close ():Closes the window that is currently ejected such as: Ymprompt.close ()

Specific use and introduction please check the Readme.txt in the package or view demo demo.

ymPrompt3.1 Download Address:Ymprompt-3.1-r-20081212.rar

ymPrompt3.1 Demo Address:Http://www.ajaxbbs.net/test/ymPrompt3.1/demo.html

ymPrompt3.0 Detailed Introduction page:http://old.ajaxbbs.net/ymPrompt3.0/
======================================================
Since the release of ymPrompt1.0 and 2.0, many Web development friends have been supported and encouraged, but also received a lot of valuable suggestions. It is also the support of everyone, so that I am more lazy people can insist on this component to improve the update down. With a lot of friends ' advice, I've made some improvements and tweaks to 2.0, and it's been enhanced in browser compatibility and functionality.

the updated content is as follows:
1, the perfect compatibility of major mainstream browsers, in ie6.0+, ff1.5+, opear9+, Safari3.1, Google Chrome 0.3.154 and other browsers are tested through.
2, support the custom button, may configure does not display the button or displays several buttons.
3, support the custom icon style, may configure does not display the icon.
4, add the Setdefaultcfg method, to set the default properties of components.
5, the components of the internal code structure made a big change, performance has been improved.
6. Supports normal form mode (no icons and buttons) and iframe form mode (incoming URL).

7, before the resolution of the version exists when the component width is too wide to display the title background is not complete problem.
8, solve the page onload before the call component regardless of the method to display Alert icon problem.

9, in the function of the increase and improvement at the same time, the program is more streamlined than before, the compressed file is only 2.0 larger than the 0.13KB, the current 3.0 compressed JS is 5.1KB.

10, added a win method, used to implement a custom pop-up box.

Demo Address:Http://www.ajaxbbs.net/test/ymPrompt3.0/demo.html

Component Downloads:http://www.ajaxbbs.net/ymPrompt3.0/

Introduction to Using methods:
1, the introduction of ymprompt.js in the page. such as: <script type= "Text/javascript" src= "Ymprompt.js" ></script>

2, in the page to introduce the corresponding skin files of CSS, such as: <link rel= "stylesheet" type= "Text/css" href= "Skin/qq/ymprompt.css"/>

3, Custom Component Default configuration information (this step is optional, this method can be invoked at any time)
Modify some or all of the default properties of a component through the Ymprompt.setdefaultcfg (CFG) method in the page's JS.
such as: Ymprompt.setdefaultcfg ({maskalpha:0.2,maskalphacolor: ' #00f '})

The default configuration for the component (the default value for the configured item will be used for items that are not set):
{
Maskalphacolor: ' #000 ',//mask Transparent Color
maskalpha:0.1,//Mask Transparency
Title: ' Caption ',//message box title
Message: ' content ',//News box button
WIDTH:300,//Wide
height:185,//High
Iframe:false,
Btn:null,
Icocls: ',
Handler:function () {}//callback Event
}
4, according to your needs to invoke the corresponding message function:
Ymprompt.alert (parameter)//message hint type
Ymprompt.succeedinfo (Parameters)//Success Information type
Ymprompt.errorinfo (parameter)//error message type
Ymprompt.confirminfo (parameter)//query message type

Ymprompt.win (Parameters)//Custom window type

There are two ways in which parameters are passed in:

The first is the traditional parameter passed in, in order to pass in the corresponding parameter values (must be in order), for the values do not need to be set, pass in null. such as Ymprompt.alert (' content ', Null,null, ' title ')
Parameter order: MESSAGE,WIDTH,HEIGHT,TITLE,HANDLER,MASKALPHACOLOR,MASKALPHA,URL,IFRAME,ICOCLS

The second way JSON is passed in, you need to specify a field name, no order, and set the relevant properties as needed. such as Ymprompt ({title: ' caption ', message: ' Content '})


The five methods have exactly the same number of parameters and meanings (all parameters are optional and default parameter values are used without passing in):

Message :The content to be displayed by the message component, which defaults to "content."
Width:The width of the message box, which defaults to 300.
Height:The height of the message box, which defaults to 185.
Title:Message component title, default to Title
Handler:The callback function. When the OK/Cancel/Close button is clicked, it triggers the function and passes in the clicked button logo. If OK is OK, Cancel is canceled, close rep is off
Maskalphacolor:The color of the mask, which defaults to black.
Maskalpha:The opacity of the mask defaults to 0.1.

The following three parameters are primarily used for the win method (you can, of course, override the default properties of the previous four message types by setting these).
iframe:Whether to load content with the IFrame method, if true, the component attempts to load the message content as a URL. The default is False.
Icocls:The icon type. The incoming content is classname, the specific method can refer to the definition of the icon in Ymprompt.css. The default is empty.
BTN:Button definition. The incoming is an array form. The format of each button is [' button text ', ' button logo '], such as [[' OK ', ' OK '],[' Cancel ', ' Cancel '],[' close ', ' closed ']].
Note that a single button should look like this: [[' OK ', ' OK ']]

5, Other notes: If the "object. Method" Call way more cumbersome, you can use the following way to simplify the call:
Set the Var alert=ymprompt.alert before calling. You can then invoke it by using alert ().


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.