About iframe function calls in text elements in skins!

Q&A about the latest versions
Post Reply
weiji
Posts: 5
Joined: Mon Apr 25, 2022 5:30 pm

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.
User avatar
k.ary.n
Gnome
Posts: 615
Joined: Wed Aug 15, 2007 1:02 pm

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.
weiji
Posts: 5
Joined: Mon Apr 25, 2022 5:30 pm

I want to call javascript function on embedded iframe.
User avatar
k.ary.n
Gnome
Posts: 615
Joined: Wed Aug 15, 2007 1:02 pm

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?
weiji
Posts: 5
Joined: Mon Apr 25, 2022 5:30 pm

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.
weiji
Posts: 5
Joined: Mon Apr 25, 2022 5:30 pm

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!
Post Reply