【发布时间】:2013-02-28 12:22:48
【问题描述】:
我有简单的代码 sn-p:
$('div').css('background-position', '0px 0px');
alert( $('div').css('background-position') );
我希望我会收到'0px 0px',但我在 IE10 中收到了“0% 0%”。
我还注意到 jquery .css 总是在等于 0px 时返回百分比结果,例如 IE10 中的 "0px 50px" => "0% 50px"。
是 jQuery 错误吗?还是 IE10 的 bug?
谢谢!
【问题讨论】:
-
看起来像是 IE 10 中的一个变化,还不一定会称之为错误 :) 但会返回 IE 9 中的输入字符串。
-
IE9 行为符合预期。 IE10 - 不是。似乎是 jQuery 问题,因为它工作正常,当我们不使用 jQuery 时:jsbin.com/emacow/5/edit
标签: javascript jquery internet-explorer internet-explorer-10 background-position