Table Of Contents

All links to examples in this documentation has following format: example

Requirements

HTML Syntax

You can use iPop without writing any javascript code. Various features of iPop are controlled using the HTML attributes.

<a href="URI"
[ ipoptype="TYPE" ]
[ ipopsize="SIZE" ]
[ ipoptemplate="TEMPLATE" ]
[ ipopcontents="HTML" ]
[ ipopclass="CLASSNAME" ]
class="iPop …">…</a>
For parameter description see the Javascript Syntax section bellow.

Javascript Syntax

Elements having the class name iPop get initialized automatically!

iPop() Method

Initialize/perform pop-up magic on selected elements

$(TARGET).iPop( [ ARG [, ARG [, …] ] ] );

Perform actions on currently displayed po-up - static calls.

$.fn.iPop( [ ARG [, ARG [, …] ] ] );

Where ARG can be one of

Examples

Click here
$('a.test').iPop("http://www.youtube.com/watch?v=kX-WnlOCvXw", "640px 480px");
Click here
$('a.test').iPop("/", {type: "iframe"}, "800px auto");
Click here
$('a.test').iPop("<h1 'white-space: nowrap;'>Hello world!</h1>", "cssClass1 cssClass2", {template: "bootstrap.warning"});
Click here
$('a.test').iPop("gmaps: White House, Washington", "800px 100%");
Click here
$('a.test').iPop("h1, h2, h3", "800px auto");

$.fn.iPop.defaults

The $.fn.iPop.default object contains default settings. It has the same syntax as OPTIONS described in Javascript Syntax section.

Example:
$.fn.iPop.default.onShow=myCallBackFce;
Default settings must be set after iPop script and prior to pop-up initialization.

$.fn.iPop.templates

The $.fn.iPop.templates object contains the template definitions. See Templates section for more info.

$.fn.iPop.defaults={TEMPLATENAME: TEMPLATE [, …]}
Where TEMPLATE can be

Callbacks

All CALLBACK functions accept following parameters

CALLBACK=function(hookName, $link, $popUp, iPopObject);

Templates

Standard Named Templates

For full list of standard templates refer to TEMPLATE definition in iPop() Method section.

Bootstrap warning template. Click here

<a href="#exampleInline" ipoptemplate="bootstrap.warning" class="iPop">Bootstrap</a>

Bare template with custom close button in the content. Click here

<a href="#exampleInline2" ipoptemplate="bare" class="iPop">Bare</a>

<div style="display: none;">
<div id="exampleInline2" style="max-width: 480px; color: white;">
<h1>Lorem Ipsum</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<hr/>
<button type="button" class="iPopClose" style="margin: 1em auto;">Close</button>
</div>
</div>

Custom Named Templates

You can create your named templates using $.fn.iPop.templates object.

<script>
$.fn.iPop.templates.myTemplate="<div>…<div class='iPopData'></div>…<div class='iPopClose'>×</div>…</div>";
</script>

<a href="#exampleInline" ipoptemplate="myTemplate" class="iPop">Bare</a>
Or you can set custom template as the default
<script>$.fn.iPop.defaults.template="myTemplate";</script>

If the custom template TEMPLATENAME has prefix default. then the default template is not removed and your template is nested inside default template.

<script>
$.fn.iPop.templates["default.myTemplate"]="<div>…<div class='iPopData'></div>…<div class='iPopClose'>×</div>…</div>";
</script>

<a href="#exampleInline" ipoptemplate="default.myTemplate" class="iPop">Bare</a>

Embedded Templates

The template parameter can be also a jQuery selector. Click here

<a href="#exampleInline" ipoptemplate="#myTemplate" class="iPop">My template</a>

<div id="myTemplate" style="display: none; background: #FFFF99; padding: 2em;">
<div class="myCloseButton iPopClose">Close</div>
<div class="myFrame">
<div class="iPopData"><!-- Here comes contents --></div>
</div>
</div>

Default Template

You can specify the default template using $.fn.iPop.defaults object.

$.fn.iPop.defaults.template="bootstrap.info";
Default template must be set after iPop script is included and prior to pop-up being shown for the first time.

Lorem Ipsum

Less lorem ipsum...

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

More lorem ipsum...