这是IE9的bug吗?

发布于 2024-11-15 07:28:54 字数 598 浏览 5 评论 0原文

我有以下代码:

HTML 正文代码:

<div>asbcakjscb<div>

CSS 代码:

div {
    width:400px;
    height:400px;
    background:red;
    -ms-transform:scale(.3);
}

JavaScript 代码:

document.quertSelector('div').style.msTransform = 'scale(1)';

JavaScript 代码在页面的加载事件上运行。您可以在以下位置运行上面的代码: http://jsfiddle.net/fakjX

我需要更改 CSS3 变换比例样式IE9 上为 0.3 到 1。但我不能。我认为这是IE9的错误。代码看起来没有问题。

你同意这是 IE9 的 bug 吗?或者你有什么解决方案来解决这个问题吗?

谢谢。

I've codes below:

HTML body codes:

<div>asbcakjscb<div>

CSS codes:

div {
    width:400px;
    height:400px;
    background:red;
    -ms-transform:scale(.3);
}

JavaScript codes:

document.quertSelector('div').style.msTransform = 'scale(1)';

The JavaScript codes are run on the page's load event. You can run code above at: http://jsfiddle.net/fakjX

I need to change CSS3 transform scale style from 0.3 to 1 on IE9. But I can't. I think this is a IE9's bug. The codes appears no problem.

Do you agree this is a IE9's bug? Or do you have any solutions to fix this problem?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮邮递员 2024-11-22 07:28:54

这不是 IE 中的错误,破折号符号在脚本中使用时无效。使用 jQuery 设置属性时,可以使用等效的驼峰命名法和对象表示法。

编辑:发现关于此主题的另一个问题 - IE9:为什么设置“-ms-transform”可以在 css 中工作,但不能在 jquery.css() 中工作

$('div').css({ msTransform: 'scale(1)' });

It's not a bug in IE, the dash notation is invalid when used in a script. You can use the camelCase equivalent and object notation when setting the property using jQuery.

Edit: Found another SO question on this subject - IE9: Why setting "-ms-transform" works from css, but not with jquery.css()

$('div').css({ msTransform: 'scale(1)' });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文