A JQuery Plugin for popups layers.
- You can open more than one popup the same time;
- There is no pre-defined layout, so you are able to create your own layout;
- You can call the popups using ajax or using the content of a hidden html element;
- The jmpopups is concerned about acessibility. When a popup is opened, the focus will be kept only inside that popup. It will directly focus the first focusable element. The idea is to help users who use the keyboard for browsing (f.e. disabled people).
- It works for IE 6+, FF 1.5+, Opera 9.x, Chrome 2.x, Safari 4.x
- Compatible with JQuery 1.3.x
$.openPopupLayer({
name: "contactForm",
width: 300,
url: "contact_form.html",
success: function() {
alert("It is loaded");
}
});
This method sets up the Plugin.
-
screenLockerBackground: (String)
This property sets the color of the screenlocker.
Default value:"#000000" -
screenLockerOpacity: (String)
This property sets the opacity of the screenlocker
Default value:"0.5"
This method opens a Popup.
-
name: (String)
This property sets the name of the popup. It's a mandatory property and should be unique.
Example:"contactForm" -
width: (int)
This property sets the width of the popup.
Default value:"auto"
Example:300 -
height: (int)
This property sets the width of the popup.
Default value:"auto"
Example:200 -
target: (String)
This property sets the id of the html element that contains the content to be used.
If you set this property, the popup will COPY the content of the element and it will ignore the url and parameters properties.
Example:"myDiv" -
url: (String)
This property sets the url to be used in the ajax request.
Example:"contact_popup.html" -
parameters: (Object - Map)
This property sets the parameters to be used in the ajax request (get),
Default value:{}
Example:{id:123, user:"guest"} -
cache: (Boolean)
If false it will force the page that you requested not to be cached by the browser.
Default value:false -
success: (Function)
This function will be called when the popup loads.
Default value:function() {} -
error: (Function)
This function will be called if an ajax error happens.
Default value:function() {} -
beforeClose: (Function)
This function will be called before the popup closes.
Default value:function() {} -
afterClose: (Function)
This function will be called after the popup closes.
Default value:function() {}
This method closes a Popup.
- name: (String)
The Popup name to be closed.
If not set, it will close the last Popup opened.
This method reloads a Popup.
-
name: (String)
The Popup name to be reloaded.
If not setted, it will reload the last Popup opened. -
callback: (Function)
This function will be called after the popups reloads. It will be executed after the success() method.