Overview
The default zoom level for new OpenFin windows is the applications default window size. The following examples explain how to use the OpenFin API to implement a feature that will set a child windows zoom level to the same value as the parent.
Example
This example uses the following OpenFin API methods, please click on each link to find out more:
- Window.getZoomLevel() - Returns the current zoom level of the application.
- Window.setZoomLevel() - Sets the zoom level of the window.
function openChildWinInheritZoom(){
// Use Window.getZoomLevel to get the parent window (This Window) zoom level
fin.desktop.Window.getCurrent().getZoomLevel(function (level) {
// Opening a new child, note that autoShow is false (default value)
// We want to change the zoom level before displaying the page
var win = new fin.desktop.Window(
{
name: "windowname",
url: "http://www.yourdomain.com/window.html",
autoShow: false
}, function() {
// Here we are using Window.setZoomLevel on the new child window, before the show() call
win.setZoomLevel(level, function () {
console.log('success');
});
//Now show the window
win.show();
});
});
}
Comments
0 comments
Please sign in to leave a comment.