还有其他人遇到过position()在IE中工作异常的问题吗?我正在尝试返回居中放置的 div 的左侧位置。 Chrome 返回 342,这是正确的。 IE9 返回 0.5。这是怎么回事?
var sp = $('.jcarousel-container').position();
alert(sp.left)
最佳答案
在你的 jsfiddle 示例中,.offset() 似乎在 IE9 中工作:
代码如下:
var sp = $('.jcarousel-container').offset();
alert(sp.left)
关于jqueryposition() 在 IE9 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8836777/