object.Style.Zoom property not working in Firefox

前端 未结 2 1952
心在旅途
心在旅途 2020-12-18 13:51

I am using object.Style.Zoom for making zoom inside the div tag, it is working in IE. I need it for firefox. Please guid me. Can i get

相关标签:
2条回答
  • 2020-12-18 14:35
    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?

    0 讨论(0)
  • 2020-12-18 14:42

    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.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题