Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing page scale via javascript

I wish to scale the body of my website acording to resolution, but the code not seems to work:

document.body.style.transform: scale(window.screen.availHeight/2);
document.body.style['-o-transform'] = window.screen.availHeight/2;
document.body.style['-webkit-transform'] = window.screen.availHeight/2;
document.body.style['-moz-transform'] = window.screen.availHeight/2;
like image 739
Dim Avatar asked Mar 22 '23 06:03

Dim


1 Answers

Try

document.body.style.transform = 'scale(' + window.screen.availHeight/2 + ')';
document.body.style['-o-transform'] = 'scale(' + window.screen.availHeight/2 + ')';
document.body.style['-webkit-transform'] = 'scale(' + window.screen.availHeight/2 + ')';
document.body.style['-moz-transform'] = 'scale(' + window.screen.availHeight/2 + ')';
like image 99
Paul Rad Avatar answered Apr 05 '23 18:04

Paul Rad