Skip to content
Mottie edited this page Jan 3, 2013 · 1 revision

Getting the API object

There are two methods you can use to access the API:

  1. Get the data object

    // You can use any variable, I used "equalizer" here only as an example
    var equalizer = $('.wrapper').data('equalizer');
  2. Get the api object

    var equalizer = $('.wrapper').getequalizer();

Once you have the api object, the following is possible:

Updating Equalizer

If you happen to have the resizable option disabled (set to false) and need to update Equalizer, use the built-in shortcut method to update:

// update equalizer by calling the function again, but with no options.
$('.wrapper').equalizer();

or use the api object:

var equalizer = $('.wrapper').data('equalizer');
equalizer.update();

Enable or Disable Equalizer (new in v1.2)

// to disable trigger disable.equalizer on the main wrapper
$('.wrapper').trigger('disable.equalizer');

// use enable.equalizer to make it work again
$('.wrapper').trigger('enable.equalizer');

or use the api object:

var equalizer = $('.wrapper').data('equalizer');

// to disable the plugin, send a `false` boolean to the enable function
equalizer.enable(false);

// use enable the plugin, just call the enable function
equalizer.enable();

API Variables and functions

Once you have the api object you can access any of these variables, options or functions:

  • equalizer.update() - direct access to the update function.
  • equalizer.suspend(boolean) - suspend equalizer (if boolean is false) until the next resize/update.
  • equalizer.enable(boolean) - disable equalizer (if boolean is false) until the enable function is called again (boolean is empty or true).
  • equalizer.options - Access to the set options. You may update the options this way, but be warned that it may not work properly. Also make sure to use update, if anything is changed.
  • equalizer.$el - jQuery object of the main wrapper element (.wrapper in the examples above).
  • equalizer.$col - jQuery object of all of the columns inside of the wrapper element. Targeted using the columns option.