Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<hotspot name="iframe" url="black.png" ath="0" atv="0" distorted="true" onloaded="add_iframe('https://www.youtube.com/embed/p4j18C0CEEg', 640, 360);" /> <action name="add_iframe" type="Javascript"> var iframe = document.createElement("iframe"); iframe.style.position = "absolute"; iframe.style.left = 0; iframe.style.top = 0; iframe.style.width = "100%"; iframe.style.height = "100%"; iframe.style.border = 0; iframe.src = args[1]; caller.registercontentsize(args[2], args[3]); caller.sprite.appendChild(iframe); </action> |
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
<hotspot name="spotwebcontent" devices="html5" tag="webcontent" visible="false" distorted="true" url="%FIRSTXML%/graphics/transparent.png" ath="-52.435618" atv="-4.781611" width="273" height="280" rx="-9.1404811779001989" ry="-10.966652145640637" rz="-2.0164699792494596" enabled="true" capture="false" handcursor="false" zorder="2" zorder_backup="2" onloaded="add_iframe(http://www.krpano.com, get(width), get(height));" /> <action name="add_iframe" type="Javascript" devices="html5"> var iframe = document.createElement("iframe"); iframe.style.position = "absolute"; iframe.style.left = 0; iframe.style.top = 0; iframe.style.width = "100%"; iframe.style.height = "100%"; iframe.style.border = 0; iframe.src = args[1]; caller.registercontentsize(args[2], args[3]); caller.sprite.appendChild(iframe); </action> |
This post has been edited 1 times, last edit by "benji33" (Nov 26th 2015, 10:51am)
Location: Netherlands
Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
Hi klaus:This could be also used to add any other html content. Only two things to respect - the size need to be set and this will work only in HTML5.
add:
Quoted
ERROR: add_iframe - TypeError: caller.sprite is null
![]() |
Source code |
1 |
renderer="css3d" |
hi klaus:Hi,
add:
Quoted
ERROR: add_iframe - TypeError: caller.sprite is null
to your element.
![]()
Source code
1 renderer="css3d"
See also here:
http://krpano.com/docu/xml/#hotspot.sprite
and here:
http://krpano.com/docu/xml/#hotspot.renderer
Best regards,
Klaus