Sie sind nicht angemeldet.

1

Sonntag, 20. Februar 2011, 19:05

Krpano + html5 + JQuery

Hello,

I have a div that contents an image.When we clic on the div, a pano replaces the image.
I use JQuery to replace the content of my div.
All works fine with the flash version of the Vtour. The Vtour starts in the div.
But, with an html5 brother, nothing works. My div is empty...

here is my javacsript function use to replace the content of the div "VirtualTour" :

function showVTour()
{
$('#VirtualTour').empty();

$("#VirtualTour").html('<div id="pani" style="width:701px; height:358px;">');

var viewer = createPanoViewer({swf:"swf/krpano.swf",target:"pani"});
viewer.addVariable("xml", "vtour.xml");
viewer.embed();

}

Thanks for your help

Via360

2

Montag, 21. Februar 2011, 08:31

After some test, i have the same problem with this simple function :

function showVTour(id,content) {
var container = document.getElementById(id);
container.innerHTML = content;

var viewer = createPanoViewer({swf:"krpano.swf",target:"VirtualTour"});
viewer.addVariable("xml", "tour.xml");
viewer.embed();
}

In this cas, i don't use JQuery, so the probleme is elsewhere.
When i look to the "activity window" on safari (user agent Ipad), i can see that the different elements of the vtour are right downloaded. But nothing is visible...
Works fine in flash but the html5 mode don't play anything...

Any idea ?

Via360

3

Montag, 21. Februar 2011, 21:23

Hi,

do you have an online example where the problem can be seen?

best regards,
Klaus

4

Dienstag, 22. Februar 2011, 08:02

Ok, Thanks for your help.

The first link :

http://www.imediaph.com/tour_exemple/tour_exemple.html

and a second link where the vtour start in html5 (direct call) but disapears when we click on the button...

http://www.imediaph.com/tour_exemple/tour_exemple2.html

I make something wrong, but what ????

5

Mittwoch, 23. Februar 2011, 17:27

Hi,

when using several viewer instances then it would be necessary to use different viewer IDs,

try adding:

Zitat

var viewer = createPanoViewer({swf:"krpano.swf",target:"VirtualTour",id:"viewer2"});
see here:
http://krpano.com/docu/swfkrpanojs/#createPanoViewer

best regards,
Klaus

6

Mittwoch, 23. Februar 2011, 18:45

Hi Klaus,

Ok, I understand what do you write (i hope). *smile*
But, i am not sure it's what happens to me.
Please forget the second link and just take a look to the first :
- if i use safari with "windows" as user agent, the vtour starts in flash when i push the button
- if i use safari with "ipad" or "iphone" user agent, the vtour don't start (it shoulds start in html5 mode).
Whithout the button and in a direct call, all works fine...
Sorry if y miss something, but i discover in the same time javascript, php, xml, flash, so sometimes it's perhaps a bit confuse *wacko*

Thanks a lot

Via360

7

Mittwoch, 23. Februar 2011, 18:57

Hi,

sorry, I have only seen the second link and there are two viewers,
and these two viewers are needing different IDs (especially the krpanoJS viewer),

about the first link - sorry, no idea yet,

best regards,
Klaus

Ähnliche Themen