floorplans.zoom(
node element,
float zoom,
int duration);
Zooms to an element so that the element is in the center of the view.
Parameters
- element
- (node) The element to zoom into.
- zoom
- (float) The zoom value, must be >0.
- duration
- (int) The duration of the zoom animation, must be >0.
Source
floorplans/public/js/controls.js
More Information
This code should be implemented in JavaScript. For extra guidance, please see WPBeginner’s tutorial on adding custom javascript.
Example
<script type="text/javascript">
var elmnt = document.querySelector( '.wp-block-floorplans-element[data-id="3"]' );
floorplans.zoom( elmnt, 1.5, 1200 );
</script>