Setting Browser Zoom

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
moorej1717
Jr. Propeller Head
Posts: 4
Joined: Tue Aug 29, 2017 8:00 am

Setting Browser Zoom

Post by moorej1717 »

When generating an HTML5 Top Nav output, is it possible to force the browser in which it opens to zoom to a particular level? My output looks good when opened on certain monitors, but not on others with a lower resolution unless it's zoomed out. Is it possible to set the zoom level to say, 80% regardless of the browser?
SteveS
Senior Propellus Maximus
Posts: 2089
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Setting Browser Zoom

Post by SteveS »

If you conduct a search you will find some sites, such as stackoverflow, have javascript for manipulating browser zoom.

It is (in my opinion) a bad practice. An application should never set a zoom level, the user might well have a good reason to select their own setting. This includes visual impairment or the physical size of the display.
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Setting Browser Zoom

Post by NorthEast »

Do not set the zoom level - it's unnecessary, as well as bad practice.

Instead, use responsive design to change the font size based on the screen size.

First, set all font sizes in your project to use em units, so that they're relative.

Then set up media queries to set the body tag font size at different screen sizes, which will set the size of 1em; e.g.

Code: Select all

@media only screen and (max-width: 1280px)
{
	body
	{
		font-size: 14px;
	}
}

@media only screen and (min-width: 1280px)
{
	body
	{
		font-size: 20px;
	}
}
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: Setting Browser Zoom

Post by RamonS »

I second that setting the zoom level is pointless. The user can very quickly change that and probably is forced to do so anyway in those case where 80% is not enough. Responsive design is clearly the way to go.
moorej1717
Jr. Propeller Head
Posts: 4
Joined: Tue Aug 29, 2017 8:00 am

Re: Setting Browser Zoom

Post by moorej1717 »

Thanks, all! I wasn't thinking about responsive design in terms of screen resolution, but will definitely help make the font size work in all situations.
Post Reply