Button always visible and same size even when zooming

Hi Michael,

This code depends on the internal implementation of the player so it’s not straightforward to convert between versions. For version 7, you can use the following code in On Load event of the slide:

var $zoomNode = $('.ap-slides', prez.container),
  zoomTransform = 'none',
  button = prez.object('Name_of_the_button'),
  $buttonNode = $(button.node);

function invertZoom() {
  if (prez.object('Name_of_the_button') != button) {
    // slide changed, should not update button anymore
    return;
  }
  // update button
  var currentZoomTransform = $zoomNode.css('transform');
  if (currentZoomTransform != zoomTransform) {
    zoomTransform = currentZoomTransform;
    var zoomMatrixData = zoomTransform.split(/\s*[(),]\s*/).slice(1, -1);
    var buttonCSS = {
      transformOrigin: '',
      transform: ''
    };
    if (zoomMatrixData.length == 6) { // matrix(a, b, c, d, tx, ty)
      var scale = 1 / zoomMatrixData[0];
      if (scale != 1) {
        var x = -zoomMatrixData[4];
        var y = -zoomMatrixData[5];
        buttonCSS.transform = 'scale(' + scale + ', ' + scale + ') translate(' + x + 'px, ' + y + 'px)';
        buttonCSS.transformOrigin = '-' + $buttonNode.css('left') + ' -' + $buttonNode.css('top');
      }
    }
    $buttonNode.css(buttonCSS);
  }
  // request update button in next animation frame
  requestAnimationFrame(invertZoom);
}

requestAnimationFrame(invertZoom);

Regards