1

I want set zoom of my page at 100% and i dont want to user can change that. I have tried some css function and js but couldn't find a proper way. I already search my question in here.

Arty
  • 859
  • 2
  • 12
  • 31
  • So you want to alter the zoom of the browser, is that correct? – Jordec Apr 02 '19 at 06:59
  • You can refer this question [Prevent zoom cross browser](https://stackoverflow.com/questions/27116221/prevent-zoom-cross-browser) – Shubham Khatri Apr 02 '19 at 07:00
  • This can make your page inaccessible for people who depend on zoom to actually be able to read the content on your page. Do you really want to exclude them? – Jasha Apr 02 '19 at 07:03
  • This isnt my own poject, product owner wants this way. – Arty Apr 02 '19 at 07:07
  • 2
    @Arty even if it is not your project, you should explain to the product owner that this would be bad practice. – Daut Apr 02 '19 at 08:51

1 Answers1

1

You can use the library detect-zoom. Once installed, in your componenet you can try

import detectZoom from 'detect-zoom';

handleZoom = () => {
    if (detectZoom.device() * 100 !== 100) {
      console.log('your zoom is not 100)
    } else {
      console.log('your zoom is 100)
    }   
 }
componentDidMount() {
    this.updateZoom();
    window.addEventListener('resize', this.updateZoom);
}
Anass TIssir
  • 240
  • 2
  • 7