我刚刚花了最后4个小时来处理这段代码,并且很高兴终于让它工作,但它不会在IE中工作!我不能理解为什么?
以下是jsfiddle上的代码:http://jsfiddle.net/hQkFH/8/
谢谢!
答案 0 :(得分:2)
该代码在Chrome中运行不正常。但是,在Internet Explorer中打破它的问题是对象文字中的尾随逗号:
$(this).clone().css({
position: "absolute",
top: offsetTop,
left: offsetLeft, // <-- here
}).attr("id", "cloned").appendTo("body");
该语法有效,但在v9之前在Internet Explorer中导致错误。