Website Box plugin - how to interact with krpano?   [SOLVED] - View the solution

Share your tips and tricks here or get help with any Panotour 2.0+ problem!
No bug reports (of any kind) in this forum!
no avatar
bitbyter
Member
 
Topic author
Posts: 40
Likes: 1 post
Liked in: 3 posts
Joined: Wed Nov 18, 2015 11:55 am
Info

Website Box plugin - how to interact with krpano?

by bitbyter » Fri Apr 13, 2018 2:18 pm

Hi, I'm trying to get a web page to appear (via website box) at the beginning of my tour to offer options - for example, if user indicates they are "business user" then activate some menu items that would normally be hidden.
When I launch the web page as a child window, the javascript I have in place can fire JS functions within the host window to successfully activate menu items. When I try launching this same page within website box, I can't figure out how to interact either with the host window or with the krpano engine directly.
Questions:
-is there any way that a page within "website box" can interact with the host page? references to window.parent, window.opener, and window.top all seem to fail
- is there a way I can reference the krpano functions directly from this page?

Thank you in advance! Scott

User avatar
360-compunics-com-ni
Member
 
Posts: 418
Likes: 15 posts
Liked in: 163 posts
Joined: Wed Dec 17, 2014 12:37 am
Location: León, Nicaragua
Info

Re: Website Box plugin - how to interact with krpano?

by 360-compunics-com-ni » Fri Apr 13, 2018 8:39 pm

Something like this should work:
Code: Select all
onclick="window.parent.krpano.call('closeKolorBox_websiteViewer();');"

or a locally defined function, served via php:
Code: Select all
<a href=\"#\" onclick=\"window.parent.ShowMorePage('$More');\">
Out now: DeviceCheck for PTP plugins! https://www.kolor.com/forum/viewtopic.php?f=40&t=37446

Want to know how clients use your tours? Google Analytics Track Events plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=34442

Add actions to your hotspots: Hotspot Actionlist plugin: http://www.kolor.com/forum/viewtopic.php?f=40&t=35829

no avatar
bitbyter
Member
 
Topic author
Posts: 40
Likes: 1 post
Liked in: 3 posts
Joined: Wed Nov 18, 2015 11:55 am
Info

Re: Website Box plugin - how to interact with krpano?  [SOLVED]

by bitbyter » Sat Apr 14, 2018 4:39 pm

THANK YOU THANK YOU THANK YOU Michael! "window.parent.krpano.call" was the answer. Appreciate your help!

360-compunics-com-ni likes this post.


Who is online

Users browsing this forum: No registered users and 3 guests