Get new jQuery plugins just once a week

×

Adi.js

FavoriteLoadingAdd to favorites

November 20, 2015

Lightweight jQuery plugin for Adblock Identification

Adi-js is a simple jQuery plugin for Adblock Identification.

Created by Marius Balaj

Download

Example

Adi-js jQuery plugin

Adblock


Adi.js :japanese_ogre:

Lightweight jQuery plugin for Adblock detection

Thumb

bower install adi.js

See it in action

To install follow the steps (order is important):

Options

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)

Methods

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

Examples

Don't let user to see the content if adblock is active

$.adi({
  onClose: function(el) {
    /* refresh each time user close the modal */
    window.location.reload(true);
  }
});

Redirect

$.adi({
  onClose: function(el) {
    window.location = 'http://some-website.com';
  }
});

Add animation to modal

``` $.adi({ onOpen: function(el) { /* make the modal bounce in by adding animate.css classes on modal */ el.find('.jquery-adi_content').addClass('animated bounceInDown') }, });

Adi.js

Related posts:

JQtemplate
Reading-Time
exLink

To install using Bower
bower install adi.js

Adi-js jQuery plugin

http://jquer.in/wp-content/uploads/2015/10/Adi-js.jpg

jQuery plugin

Sign up for our weekly newsletter.

* We won't spam you ever