code: function () {
        var self = this;
  
        $(this.scope)
          .on('click.fndtn.clearing', 'ul[data-clearing] li',
            function (e, current, target) {
              var current = current || $(this),
                  target = target || current,
                  next = current.next('li'),
                  settings = self.get_data(current.parent()),
                  image = $(e.target);
  
              e.preventDefault();
              if (!settings) self.init();
  
              // if clearing is open and the current image is
              // clicked, go to the next image in sequence
              if (target.hasClass('visible') 
                && current[0] === target[0] 
                && next.length > 0 && self.is_open(current)) {
                target = next;
                image = target.find('img');
              }
  
              // set current and target to the clicked li if not otherwise defined.
              self.open(image, current, target);
              self.update_paddles(target);
            })
  
          .on('click.fndtn.clearing', '.clearing-main-next',
            function (e) { this.nav(e, 'next') }.bind(this))
          .on('click.fndtn.clearing', '.clearing-main-prev',
            function (e) { this.nav(e, 'prev') }.bind(this))
          .on('click.fndtn.clearing', this.settings.close_selectors,
            function (e) { Foundation.libs.clearing.close(e, this) })
          .on('keydown.fndtn.clearing',
            function (e) { this.keydown(e) }.bind(this));
  
        $(window).on('resize.fndtn.clearing',
          function () { this.resize() }.bind(this));
  
        this.settings.init = true;
        return this;
      }
docs: event binding and initial setup