Using the Javascript API

The entire functionality behind Engage Box is based on a jQuery plugin built from scratch. This plugin gives you the ability to manipulate any box by calling specific functions such as open or close. Also you can use even more specific events to listen on, such as beforeOpen and beforeClose.

Methods

Open

Open the box

$("#rstbox_1").trigger("open");

Close

Close the box

$("#rstbox_1").trigger("close");

Close and Keep Hidden

Close the box and keep it hidden using the duration you have set on the After Close Stay Hidden field.

$("#rstbox_1").trigger("closeKeep");

Set the cookie expiration time

Manually set the time you want the box to stay hidden. This command overrides the After Close Stay Hidden and the Cookie Duration field values.

In Seconds

$("#rstbox_1").trigger("setCookie", ["seconds", 200]);

In Minutes

$("#rstbox_1").trigger("setCookie", ["minutes", 120]);

In Hours

$("#rstbox_1").trigger("setCookie", ["hours", 12]);

In days

$("#rstbox_1").trigger("setCookie", ["days", 7]);

For Ever

$("#rstbox_1").trigger("setCookie", ["ever"]);

For Session

$("#rstbox_1").trigger("setCookie", ["session"]);

Remove the Expiration Cookie

$("#rstbox_1").trigger("setCookie", ["remove"]);

Events

beforeOpen

This event fires before the box opens

$("#rstbox_1").bind("beforeOpen", function() {
	// your code
});

afteropen

This event fires after the box opens

$("#rstbox_1").bind("afterOpen", function() {
	// your code
});

beforeClose

This event fires before the box closes

$("#rstbox_1").bind("beforeClose", function() {
	// your code
});

afterclose

This event fires after the box closes

$("#rstbox_1").bind("afterClose", function() {
	// your code
});

One-Time Events

There are times when you want to attach a handler to a box's event that is executed at most once per box per event type. Just replace the jQuery bind method to one.

Firing once the afterOpen event

$("#rstbox_1").one("afterOpen", function() {
	// your code
});

Firing once the afterClose event

$("#rstbox_1").one("afterClose", function() {
	// your code
});

Notes

Document ready combined with self enclosure

Please note that any above example will not work unless you wrap it with the Combined Document Ready - Self Enclosure snippet.

jQuery(function($) {
	// your code goes here
});

Note: The above code blocks refair to the box with id #1 for demonstration purposes. Replace this number with your box's id.

Downloads

Find the download links to the extensions you have a valid subscription for.

View Downloads

Documentation

Read a growing list of tutorials, articles and frequently asked questions.

Read Documentation

Subscriptions

A detailed list with your active or expired subscriptions.

View Subscriptions

Old Releases

Download older releases of the extensions you have a valid subscription for.

Download Old Releases

Help me Grow

If you love using my extensions or have had a positive experience I am asking you to spread the word.

Write a Review on JED

Support

I am always happy to help! If you can't find answers, feel free to send me a message.

Contact me
×
×
Get Engage Box for Joomla! for just 29€ Get it now!
×
Don't miss a thing!
Stay up-to-dated with my latest blog articles
Receive updates for my Joomla Extensions
No Spam! It's a promise.