fitScale

Determines the fit scale factor based on two elements' boxes.

Parameters

firstElementHTMLElementThe first element.
secondElementHTMLElementThe second element.

ReturnsNumber The fit scale for the two elements.

Example

<div id="foo" style="position: absolute; top:10px; left: 10px; height: 200px; width: 200px"></div>
<div id="bar" style="position: absolute; top:10px; left: 10px; height: 100px; width: 50px"></div>
<script>
    var fooBox = kendo.effects.box($("#foo"));
    var barBox = kendo.effects.box($("#bar"));

/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(kendo.effects.fitScale(barBox, fooBox)); // 0.5;
</script>
In this article