jquery.leadbox.js

A simple modal plugin for lead capture purposes.

Quick Info

The plugin loads a modal box with user-defined content after a specified amount of time. Then, a cookie is set to prevent the box from showing up on future page requests.

It is customizable and easy to setup, you can set its content from either an element in your HTML document or a remote location. Among other options, you can also set callbacks for actions taken (form submitted or link clicked), leadbox done loading, and closed by the user.

How to use

  1. Include jquery and jquery.leadbox-0.1.js into your HTML document
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> 
    <script type="text/javascript" src="/leadbox/jquery.leadbox-0.1.js"></script>
  2. Either include the jquery.leadbox.css file provided with the plugin or copy its content into your own stylesheet.
    <link type="text/css" rel="stylesheet" href="/leadbox/jquery.leadbox.css" />
  3. Create an element to use as leadbox's content
    <div id="myLeadBox">
        Enter your content here..
    </div>
  4. Call jquery.leadbox passing your custom params, example:
    <script type="text/javascript">
    
    $(document).ready(function() {
       $('#myLeadBox').leadbox({
          closeButton: '<img src="images/close_btt.png" alt="" />',
          cookieTime: 7,
          interval: 30000,
          width: 500,
          height: 350
       });
    });
    
    </script>
  5. That's it

Params

More Examples

Tips & Observations

About

Developed by Rodrigo Z. Arthuso (arthuso.com).
Tested on IE7+, FF 4, Chrome 9+, Opera 11 and Safari 5.
For help or bug reports, please visit: blog.arthuso.com / github.com/zrod/leadbox
Dual licensed under MIT and GPL.

Changelog

jQuery.LeadBox.js

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed felis ipsum. Aliquam id enim enim, eget luctus ligula. Duis in mi eu leo porta iaculis ac consectetur neque. Integer dapibus mollis eros nec luctus. Aenean lobortis enim sed nisl egestas facilisis.

  • Duis sem neque, egestas a posuere et, laoreet scelerisque arcu.
  • Nulla facilisi.