I just bought and set up this html5 pano viewer. Loading panos onload
of the browser does not suit my needs. I need it to launch based on a
javascript event (click). So I took the demo, wrapped the js in a
function and hooked up a link to that function, so I could trigger it
with the click. Well that doesn't work for me. This is what I did at
the end of the file:
Code
<script>
function test1(){
var viewer = createPanoViewer({swf:"krpano.swf", xml:"includes/tour.xml", target:"panocontent"});
if ( viewer.isHTML5possible() )
{
viewer.useHTML5("always");
viewer.embed();
}
else
{
// show error message
document.getElementById("nonhtml5infos").style.display = "inline";
}
}
//test1();
</script>
<a href="#" onclick="test1();return false;">load pano</a>
Display More
VERY simple! Anyway, you can view it in action here:
http://archive.cyark.org/iphone/krpano_html5only.html
What's wrong? Why isn't this working for me? I just need to wrap the calls in a function, and then hook up that function to some other js event. Any help would be greatly appreciated.