code: function() {
              var element = this.element,
                  template = this.template,
                  offset = element.offset(),
                  width = element.outerWidth(),
                  height = element.outerHeight(),
                  position = this.options.position,
                  alignment = this.options.alignment,
                  styles = {},
                  self = this;
  
              template.show();
  
              // Place the template
              switch (position) {
                  case 'bottom':
                      styles.top = offset.top + height;
                      break;
                  case 'right':
                      styles.left = offset.left + width;
                      break;
                  case 'top':
                      styles.top = offset.top - template.outerHeight();
                      break;
                  case 'left':
                      styles.left = offset.left - template.outerWidth();
                      break;
              }
  
              // Align the template arrow
              switch (alignment) {
                  case 'left':
                      styles.left = offset.left;
                      break;
                  case 'right':
                      styles.left = offset.left + width - template.outerWidth();
                      break;
              }
  
              template.css(styles);
          }
docs: Set template position