Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proper scaling (images too) #23

Open
MattiJarvinen-BA opened this issue Jul 26, 2012 · 1 comment
Open

proper scaling (images too) #23

MattiJarvinen-BA opened this issue Jul 26, 2012 · 1 comment

Comments

@MattiJarvinen-BA
Copy link

Sometimes displays/projectors/whatnot used to give presentations are in very different sizes scaling images and content could be useful.

Example code from some projects I have used.

// when resizing
var denominator = Math.max(
        body.clientWidth / window.innerWidth,
        body.clientHeight / window.innerHeight
);

var transform =  'scale(' + (1 / denominator) + ')';

// scale body  individual slides scale at the same time
// if background is not supposed to scale set it to html
body.style.WebkitTransform = transform;
body.style.MozTransform = transform;
body.style.msTransform = transform;
body.style.OTransform = transform;
body.style.transform = transform;
@LeaVerou
Copy link
Owner

Yeah, that's a thought I already have. Give up the font scaling code and just use transforms.
One potential issue with that is that the aspect ratio is always the same. But I guess that’s not very important. Hmm. I need to think about it a bit more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants