Page 1 of 1

About iframe function calls in text elements in skins!

Posted: Thu Sep 01, 2022 9:14 am
by weiji
I've been working on a feature recently, but I'm not very good at coding.
In the pano2vr skin, I created a new text element with an iframe embedded in it. There is a button in the iframe. Clicking it invokes the function of pano2vr. Alternatively, click the button in pano2vr to trigger the function in the iframe.
I've seen some examples of iframe function calls in forums, all about embedding pano2vr as an iframe in a web page. And my requirement is that the web page is embedded in the pano2vr skin as an iframe, and the functions between the two call each other.

Re: About iframe function calls in text elements in skins!

Posted: Thu Sep 01, 2022 9:48 am
by k.ary.n
I'm not sure how you want to connect the two. But it seems easiest to open the webpage as a popup that you can close and return to the tour.

Have you seen this webinar about embedding content? If not, then I think you'll find what you need there.

Re: About iframe function calls in text elements in skins!

Posted: Thu Sep 01, 2022 10:17 am
by weiji
I want to call javascript function on embedded iframe.

Re: About iframe function calls in text elements in skins!

Posted: Thu Sep 01, 2022 11:01 am
by k.ary.n
I'm still not clear on exactly what you're trying to achieve, and it could be you don't need Javascript at all.

However, take a look at this example, where an ObjectVR is used as a "map" to change nodes of a tour. Here, a call is being added to the skin (hotspot template) to open panoramas. Maybe this is what you're looking for?

Re: About iframe function calls in text elements in skins!

Posted: Thu Sep 01, 2022 12:40 pm
by weiji
Sorry, maybe my description is not clear enough, what I want is not only to embed the iframe webpage in the skin element, but also to trigger the events defined in the iframe webpage through the skin events.
PS:The iframe is embedded in the skin element, and I can call the iframe function with the skin element.
For example, I made a Web3D webpage, which has a function of model rotation. When I embed this webpage into the skin element of Pano2vr(iframe in text), and I create a new rectangle element. When I click on the rectangle, the rotation event in the Web3D webpage is triggered.

Re: About iframe function calls in text elements in skins!

Posted: Sun Sep 04, 2022 10:35 am
by weiji
I found a discussion article, it might be the solution.(viewtopic.php?f=6&t=14660&p=61585&hilit ... ion#p61585)
Of course, I hope that everyone can discuss this issue in more depth.Thank you!