Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Donnerstag, 24. Juni 2021, 00:34

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/steel…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:

Quellcode

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


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

Quellcode

1
2
3
4
5
6
7
8
9
10
	<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

light_line

Fortgeschrittener

Beiträge: 169

Beruf: krpano freelancer || creating ideas & coding them || krpano developer

  • Nachricht senden

2

Freitag, 23. Juli 2021, 14:33

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



Best,
Hamid