sat
sat

Reputation: 41076

zoom out using javascript css

for zooming I am using el.style.zoom = 1.5; el.style.WebkitTransform = 'scale(1.5)';

here e1 will be ,

I use webkit based browsers.

Now how do I zoom back to original size ? Confused bec document says for zoom out have to use less than 1, and how to scale back to original size in webkit ?

Upvotes: 1

Views: 3256

Answers (1)

Dan Herbert
Dan Herbert

Reputation: 103377

Use percentages.

For zoom in:

el.style.zoom = "150%";

For zoom to normal:

el.style.zoom = "100%";

This should work in webkit browsers.

Upvotes: 2

Related Questions