jquery.tent for Simple Popups


I created a new jQuery plugin for handling simple pop-ups.  The plugin is called jquery.tent.  It is available here (https://github.com/danielbank/jquery.tent).  It is based off a tutorial by Keith Wood for making jQuery plugins (http://keith-wood.name/pluginFramework.html).  I highly recommend this tutorial because it explains things quite well and the code itself is really well written.

Usage of jquery.tent is simple:

1. Initialize a DOM element as a tent.

$("#pop-up").tent();

 


2. Set the tent options to control the location where the popup is shown.

$("#pop-up").tent('option', {left: 0, top: 0});

 


3. Show the pop-up.

$("#pop-up").tent('show');

 


4. Hide the pop-up.

$("#pop-up").tent('hide');

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s