0

I'm working on a web project and by mistake I have developed the website with "90%" zoom thus, the page on development stage looks decent, the font sizes are perfect. Now I don't feel like adjusting each and every components thus if it's possible to change the zoom level programatically that would really help me.

Before posting this question, I have done a little research and found this

var scale = 'scale(1)';
document.body.style.webkitTransform =  scale;    // Chrome, Opera, Safari
document.body.style.msTransform =   scale;       // IE 9
document.body.style.transform = scale;     // General

This is great but when using this, it decreases the size of the body thus creating empty spaces/margin on the borders and doesn't really effect the zoom level in the way it does when changing the browser zoom level from the settings option

If anyone can point me in right direction, it would save me from scratching my head and a lot of time as well.

Looking forward for a trick!!

silverFoxA
  • 4,549
  • 7
  • 33
  • 73
  • 1
    You can't change a users zoom settings for them. That'd be a nightmare. Imagine an advertisement that changed your zoom level to 400%. Time to start re-working your site! – Mike Cluck Oct 13 '16 at 16:29
  • 1
    http://stackoverflow.com/questions/1055336/changing-the-browser-zoom-level You need to find a better way than changing the zoom level because that is not reliable let alone supported. – Jack Oct 13 '16 at 16:29
  • @MikeC I understand the issues that might come but is there a way to solve this particular problem the easy way? – silverFoxA Oct 13 '16 at 16:30
  • @silverFox Honestly, reworking your site *is* the easy way. You've already messed with performing a CSS scale and found out it doesn't really work for what you want. Built-in zooming in browsers is not consistent between browsers so even if you did find some way to fanangle that together, it would not look correct across different platforms. Sorry, that's just the truth. – Mike Cluck Oct 13 '16 at 16:32
  • @JackNicholson So, are you suggesting to change the zoom level of components instead of changing the browser zoom level? – silverFoxA Oct 13 '16 at 16:32
  • @MikeC Sure I understand and agree on the points you have mentioned as well, but at the same time redoing the complete website will be time consuming. Thus, I'm looking for a optimal solution – silverFoxA Oct 13 '16 at 16:37
  • @silverFox You shouldn't have to redo the entire site. You should be able to just tweak your CSS. If not, it might be worth your time to refactor it anyway. Stuff like this is why it's a good idea to strictly separate the structure of your site from how it's displayed (at least as much as possible) – Mike Cluck Oct 13 '16 at 16:39
  • @MikeC Sure definitely, I will give it a try – silverFoxA Oct 13 '16 at 16:41

0 Answers0