Hi, I would like to know how zoom property can be controlled through javascript, like div.style.top , how to specify for zoom ?
A:
It doesn't exists it seems. Here's a table with (I think all) css properties to javascript. http://codepunk.hardwar.org.uk/css2js.htm
Robin
2010-01-08 08:30:36
Thanks for the link , useful . unfortunately no zoom as u have mentioned!
sat
2010-01-08 08:48:34
+1
A:
It is a property of style
, but it's not supported by all browsers. It's a non-standard Microsoft extension of CSS that Internet Explorer implements. It is accessed like this:
div.style.zoom
zombat
2010-01-08 08:41:42
+4
A:
The Firefox & Chrome (Webkit) equivalents to the IE-specific zoom
property are, respectively, -moz-transform
and -webkit-transform
.
A sample code would be:
.zoomed-element {
zoom: 1.5;
-moz-transform: scale(1.5);
-webkit-transform: scale(1.5);
}
You'd have to be a bit more careful with Javascript (test for existence first), but here's how you'd manipulate them:
el.style.zoom = 1.5;
el.style.MozTransform = 'scale(1.5)';
el.style.WebkitTransform = 'scale(1.5)';
K Prime
2010-01-08 08:43:46
el.style.zoom = 1.5;Works cool, I was giving value in wrong way !, What are the acceptable numbers for zoom ?? Is it between 1 to 2 and if I mention 1.5 is it 150 % ?
sat
2010-01-08 09:07:26
I am using above suggestion,now how to zoom back to original size ? lil confused here , documentation says have to use value less than 1 to zoom out , and how to scale back to original size ??
sat
2010-01-08 14:31:47