You are not logged in.

esys

Intermediate

  • "esys" started this thread

Posts: 267

Location: Balazé France

Occupation: photographer

  • Send private message

1

Wednesday, March 21st 2012, 4:28pm

Html syntax?

Hi,

I'd like to use the syntax Klaus used in his last release index.html example, to lead an iphone, ipad, tablet, ipod, android request on a different xml.
I can't check if it works without appropriate devices. Could someone tell me if it's correct? Specially with devices names, it appears that iPhone take a "P" instead of usual "p", what about the others?

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
<!DOCTYPE html>
<html>
<head>
	<title>Port_Castelsardo</title>
	<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<style>
		@media only screen and (min-device-width: 800px) { html { overflow:hidden; } }
		html { height:100%; }
		body { height:100%; overflow: hidden; margin:0; padding:0; font-family:Arial, Helvetica, sans-serif; font-size:16px; color:#FFFFFF; background-color:#000000; }
		a{ color:#AAAAAA; text-decoration:underline; }
		a:hover{ color:#FFFFFF; text-decoration:underline; }
	</style>
</head>
<body>

<script src="tour.js"></script>

<div id="pano" style="width:100%; height:100%;">
	<noscript><table style="width:100%;height:100%;"><tr style="valign:middle;"><td><div style="text-align:center;">ERROR:<br/><br/>Javascript not activated<br/><br/></div></td></tr></table></noscript>
	<script>

		embedpano({swf:"tour.swf", xml:"tour.xml", target:"pano"});
	if( viewer.isDevice("iPhone|iPod|Android|iPad|Tablet") )
		viewer.addVariable("xml", "mobile.xml");
	
	</script>
</div>

</body>
</html>

Thank you. *smile*
Steph.
Steph

2

Wednesday, March 21st 2012, 5:53pm

Hi,

when you want to do that, you need to use the 'createPanoViewer' function instead the 'embedpano' function,
e.g.

Source code

1
2
3
4
var viewer = createPanoViewer({swf:"tour.swf", xml:"tour.xml", target:"pano"});
if( viewer.isDevice("iPhone|iPod|Android|iPad|Tablet") )
  viewer.addVariable("xml", "mobile.xml");
viewer.embed();


best regards,
Klaus

esys

Intermediate

  • "esys" started this thread

Posts: 267

Location: Balazé France

Occupation: photographer

  • Send private message

3

Monday, March 26th 2012, 10:05pm

Hi Klaus,

Great! Thanks a lot ;-)

Steph
Steph