flex-users / flex-iframe

IFrame component for Flex applications.
github.com/flex-users/flex-iframe
120 stars 63 forks source link

when placing flex swf in a centered div ( where flex is not 100% of the page) the iframe posiitioning is off in IE7 #15

Open nicoulaj opened 13 years ago

nicoulaj commented 13 years ago

Originally filed by grantmar...@gmail.com on 2010-11-17T11:47:32

What steps will reproduce the problem?

  1. Create a div with text-centered ( for ie7/ie8)
  2. place flash file in the div and set flex application layout to "absolute"
  3. create iframe in a container inside the flash file

What is the expected output?

iframe should position over the flex application relative to its container.

What do you see instead?

iframe is all the way to the left outside of the container.

What version of Flex-IFrame are you using?

1.4.6

On what operating system and which navigator (specify the version too)?

Windows 7, IE7 ( IE8 with IE7 compatibility mode turned on)

Did you follow the users guide ? Particularly, did you set "wmode" to "opaque" ?

yes

Please provide any additional information below, and a sample Flex 3 project reproducing the issue if possible.

The offset property in IE7 is being reported as 0 when the parent div is centered using text-center in the movieframe function of the library.

We have "hacked" our local copy since we use jquery to fix this ( not suggesting this is a long term fix for the actual library)

IFrameExternalCalls.as

INSERT_FUNCTION_MOVEIFRAME

I changed the offset javascript to use jquery ( since we have it in our project) as follows :

from :

"var swfObject = document.getElementById(objectID); " + "frameRef.style.left = x + swfObject.offsetLeft + 'px'; " + "frameRef.style.top = y + swfObject.offsetTop + 'px'; " +

to :

"var swfObjectOffset = $('#' + objectID).offset(); " + "frameRef.style.left = x + swfObjectOffset.left + 'px'; " + "frameRef.style.top = y + swfObjectOffset.top + 'px'; " +

this fixes the issue for me, but of course since the flex iframe is pure js it will need some "special" IE7 tweaking if you're not using jquery.

Cheers Grant

bluetubeinteractive