Web browser zoom

Hello guys!

I just started using Ignition last week and I have an issue now. I have to use the Web browser to display a page which is being stored on company server. It is fine displaying the page on a big screen with resolution from 1650x1050 and over but when I try to display it on a small laptop screen with resolution 1366x768 it only resizes horizontally and I am ending up with a scroll bar on the side. I found a way to resize it properly using the “Zoom level” property of the Web browser. So my question is it possible to get Ignition to change the “Zoom level” based on screen’s resolution using scripting? If yes could you give me a hint how to do it? Thank you in advance!

Hi,

This is definitely possible! You will need to create a script on the window itself (not the root container, but one level up). You’ll want to put the script on the ‘internalFrameActivated’ event handler, and your script should look something like the following:

if event.source.size.width <= 1600:
	event.source.rootContainer.getComponent('Web Browser').zoomLevel = 2

Could this be used as a script on a button that displays a pop up?

I’m having the same issue currently on a project in perspective that scada is being displayed on a pc screen with 1080 resolution and an hmi of 1024.

That toggle button has set as an event to display a pop up in the middle of the screen. Although the different resolutions result this pop up to jump on different coordinates on each screen.

So my question is, can ignition utilise scriptin in order to bind a script on the button to basically display that pop up on a certain coordinate only when the resolution is 1024 for instance? Would this be an event or a script attached on visibility?

Any suggestions on how the script would be like would be highly appreciated. Thank you in advance

This old thread is totally unrelated to Perspective (it didn’t exist in 2015). You should have posted a new topic.

Thanks for that Phil. I will put it as a new post. Although do you have any recommendations regarding this issue on the meantime? Would be highly appreciated. Thanks