jquery.ipop.css
jquery.ipop.js
or jquery.ipop.min.js
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>
iPop
get initialized automatically!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
function($element, iPopObject)
callback that returns jQuery object, DOM element, HTML string or jQuery selector.show
show pop-up.hide
hide pop-up.destroy
destroy the pop-up element (remove it from DOM).resize
resize the pop-up."WIDTH HEIGHT"
. Standard units including %
and keyword auto
supported. (Eg. "640px 480px"
or "80% auto"
)./tips.html
)#
ID display only fragment of a document identified by ID attribute. (Eg. ./tips.html#tip1
)gmaps:LOCATION
. Display location on Google Maps. (Eg. gmaps: Eiffel Tower, Paris
)http://www.youtube.com/watch?v=kX-WnlOCvXw
)http://vimeo.com/12493449
)p.myWarning, p.about
)uri
same as URIcommand
same as COMMANDcontents
same as CONTENTStype
override automatic detection and force the pop-up type. One of keywords:
image
inline
iframe
gmaps
youtube
vimeo
className
same as CLASSNAMEsize
same as SIZEwidth
same as specifying SIZEheight
same as specifying SIZEtemplate
specify the look & feel of the pop-up. TEMPLATE can be one of:
default
for default look&feel. Showdefault.blue
default variant. Showdefault.glass
default variant. Showdefault.violet
default variant. Showdefault.silver
default variant. Showdefault.dark
default variant. Showbare
to remove all pop-up formatting including the close button. Showbootstrap.info
Bootstrap-like pop-up (requires Bootstrap). Showbootstrap.success
Bootstrap-like pop-up (requires Bootstrap). Showbootstrap.warning
Bootstrap-like pop-up (requires Bootstrap). Showbootstrap.danger
Bootstrap-like pop-up (requires Bootstrap). Showdefault.
TEMPLATENAME custom template id that extends the default template (default template is added on top of your custom template).onShow
custom CALLBACK to be cooled when pop-up is shown.onHide
custom CALLBACK to be cooled when pop-up is hid.onResize
custom CALLBACK to be cooled when pop-up is resized.onDestroy
custom CALLBACK to be cooled when pop-up is removed from the DOM.onCreate
custom CALLBACK to be cooled when pop-up element is added to the DOM.$('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");
The $.fn.iPop.default
object contains default settings. It has the same syntax as OPTIONS described in Javascript Syntax section.
$.fn.iPop.default.onShow=myCallBackFce;
The $.fn.iPop.templates
object contains the template definitions. See Templates section for more info.
$.fn.iPop.defaults={TEMPLATENAME: TEMPLATE [, …]}Where TEMPLATE can be
All CALLBACK functions accept following parameters
CALLBACK=function(hookName, $link, $popUp, iPopObject);
onHide
)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>
You can create your named templates using $.fn.iPop.templates
object.
<script>Or you can set custom template as the default
$.fn.iPop.templates.myTemplate="<div>…<div class='iPopData'></div>…<div class='iPopClose'>×</div>…</div>";
</script>
<a href="#exampleInline" ipoptemplate="myTemplate" class="iPop">Bare</a>
<script>$.fn.iPop.defaults.template="myTemplate";</script>
iPopClose
or close
will automatically close pop-up upon click.iPopData
will contain the contents of the pop-up.inlineTmpl
in case your TEMPLATE is not named template.
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>
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>
You can specify the default template using $.fn.iPop.defaults
object.
$.fn.iPop.defaults.template="bootstrap.info";