I am using object.style.zoom
for making zoom inside the div tag, it is working in IE. I need it for Firefox. Please guide me. Can I get any replacement for style.zoom
.
Asked
Active
Viewed 1.2k times
2

Heretic Monkey
- 11,687
- 7
- 53
- 122

Subash
- 61
- 1
- 2
- 9
2 Answers
7
zoom
is not implemented in Firefox.
The "replacement" is transform
from CSS3: https://developer.mozilla.org/En/transform
A JavaScript example for Firefox:
document.getElementById('x').style.MozTransform = "scale(2)";
document.getElementById('x').style.MozTransformOrigin = "0 0";
It's worth pointing out that CSS3 transforms are supported in all modern browsers. You should only be using zoom
as a fallback for IE8 and lower.

thirtydot
- 224,678
- 48
- 389
- 349
-
Thanks a lot, its working fine. But its going out of div tag. Can u help. Can i set top and left be 0. – Subash Aug 24 '11 at 13:32
-
Yes, you can adjust the [`transform-origin` property](https://developer.mozilla.org/En/CSS/-moz-transform-origin). I've updated my answer. – thirtydot Aug 24 '11 at 13:37
-
Your code for zoom is working without any disturb. I am try for object.runtimestyle.filter='Gray' for gray scale and object.runtimestyle.filter='Invert' for invert color. These things are working fine in IE, but firefox. Can u help for this. – Subash Aug 26 '11 at 10:57
-
Sure, but you should ask a new question. For those two, the answer isn't just a single line of JavaScript. – thirtydot Aug 26 '11 at 11:00
1
document.getElementById("myMainBody").style.transform = "scale(0.8)";
document.getElementById("myMainBody").style.transformOrigin = "0 0";
Given script shows unwanted "OPTIONS" panel in Firefox/Chrome browser
The above script brings unwanted "OPTIONS" panel in Firefox/Chrome browser. I tested with Chrome too, this appears at chrome too (But we have an alternate in chrome, ie. style.zoom). Is there any way we can get rid of this OPTIONS panel in Firefox, which is shown when we use the above script?

alyssaeliyah
- 2,214
- 6
- 33
- 80

Sakthivel Loga
- 11
- 2