CSS zoom property

2019-02-13 19:54发布

Sitepoint reference says

Internet Explorer for Windows versions 5.5 and above support the non-standard property zoom, which sets the magnification scale of an element. There’s no CSS3 equivalent to this property (as yet).

How can I achieve this zoom effect in standard browsers? Any jQuery plugins available?

2条回答
干净又极端
2楼-- · 2019-02-13 20:10

To complete the answer of scale transformations: why you not addressing IE as well? There is a specific -ms-zoom property, which will work in IE only: http://msdn.microsoft.com/en-us/library/ie/ms531189(v=vs.85).aspx

查看更多
叼着烟拽天下
3楼-- · 2019-02-13 20:14

The CSS3 equivalent is in the CSS 2D Transforms module, in particular transform: scale().

Because this module is still at Working Draft stage, you'll need browser-specific prefixes:

transform: scale(2);
-moz-transform: scale(2);
-webkit-transform: scale(2);
-o-transform: scale(2);

You may also need transform-origin (and browser-specific versions) to make it behave the same way as zoom, and you'll have to be careful to target zoom only at IE, because WebKit supports both transform and zoom so would double-scale.

查看更多
登录 后发表回答