Lightweight jQuery plugin for Adblock detection
- Include
jQuery
- Include
advertisement.js
and make surejQuery.adblock = false;
is inside the file - Include
jquery.adi.js
- Call
$.adi({ /* your options here */ })
All parameters are optional.
Option | Type | Description |
---|---|---|
title |
string/html |
Modal's title |
content |
string/html |
Modal's description |
theme |
string |
Available: light , dark (default: light ) |
Method | Description |
---|---|
active() |
Callback function triggered when $.adblock is undefined .Adblock is active |
inactive() |
Callback function triggered when $.adblock is false .Adblock is inactive |
onOpen() |
Callback function triggered when modal is appended to document.body and display is set to block |
onClose() |
Callback function triggered when modal's display is set to none |
$.adi({
onClose: function(el) {
/* refresh each time user close the modal */
window.location.reload(true);
}
});
$.adi({
onClose: function(el) {
window.location = 'http://some-website.com';
}
});
$.adi({
onOpen: function(el) {
/* make the modal bounce in by adding animate.css classes on modal */
el.find('.jquery-adi_content').addClass('animated bounceInDown')
},
});