Close iFrame from pano shown within the iFrame

  • Hi All,

    I have been trying to get this to work for several days. I have an iFrame that displays a pano. The pano has a hotspot (Yellow A) in it. I am trying to set up an "onclick" that closes the iFrame window.

    I am using a modified version of one of the example for testing:
    https://s3.us-west-1.amazonaws.com/steelblue.medi…Test/index.html

    I have tried several things, but I can't figure out how to call the 'pop_close action in the base XML file. Is this the right way, or is there a better method to close this iFrame window?

    Here is the onclick code that I am trying for the Yellow A hotspot:

    Code
    onclick="document.getElementById('krpanoSWFObject').call('popup_close()');

    Here is the action I am trying to the hot spot to run:

    Code
    <action name="popup_close">
    		set(global.plugin[popup_bg].enabled, false);
    		set(global.events[popup].name, null);
    		tween(global.plugin[pp_blur].range, 0.0);
    		tween(global.layer[popup_bg].bgalpha, 0.0, 0.25);
    		tween(global.layer[popup].alpha, 0.0, 0.25, default,
    		removelayer('popup_bg', true);
    		scope(private:POPUP, delete(popup); );
    		);
    	</action>

    Many thanks for your help, or for pointing me in the right direction,
    Travis

  • Hi Tavis,

    If I understood correctly, you are trying to close a popup in the Krpano environment from the parent of the Iframe. right?
    If I am right, you can use the "Window.postMessage()" function to communicate between the iframe and its parent.
    You can read the documentation here:
    https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage[/size]

    [size=10]

    Best,
    Hamid

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!