如果 swf 不是 body 的直接子元素,
获得 offset 在IE下,是相对于 父元素的,而不是相对于body的。
导致 iframe 的位置错误。
修改了 IFrameExternalCalls.as 中的代码 ,采用 jquery 计算 offset .
public static var INSERT_FUNCTION_MOVEIFRAME:String =
"document.insertScript = function () " +
"{ " +
"if (document." + FUNCTION_MOVEIFRAME + "==null) " +
"{ " +
FUNCTION_MOVEIFRAME + " = function(frameID,iframeID,x,y,w,h,objectID) " +
"{" +
"var frameRef = document.getElementById(frameID); " +
"var swfObject = document.getElementById(objectID); " +
"var offset = jQuery(swfObject).offset();"+
"frameRef.style.left = x + offset.left + 'px'; " +
"frameRef.style.top = y + offset.top + 'px'; " +
"frameRef.style.width = w + 'px'; " +
"frameRef.style.height = h + 'px'; " +
"var iFrameRef = document.getElementById(iframeID); " +
"iFrameRef.width = w;" +
"iFrameRef.height = h;" +
"}" +
"}" +
"}";
转载:http://hzlinux.blog.bokee.net/bloggermodule/blog_viewblog.do?id=8158999