Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ronaldtichelaar« (5. November 2008, 21:46)

|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 |
<script type="text/javascript">
var random_xml = "top" + (1+Math.ceil(Math.random()*3)) + ".xml";
swfobject.embedSWF("./krpano.swf", "krpano1", "1024", "249", "9.0.28",
"swfobject21/expressInstall.swf",
{pano:random_xml},
{allowfullscreen:false, bgcolor:"#000000"},
{id:'krpano1', name:'krpano1'});
</script>
|
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »ronaldtichelaar« (6. November 2008, 00:35)
|
|
Quellcode |
1 |
var random_xml = "top" + (1+Math.ceil(Math.random()*3)) + ".xml"; |
|
|
Quellcode |
1 |
var random_xml = "top" + (Math.ceil(Math.random()*4)) + ".xml"; |
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »ronaldtichelaar« (6. November 2008, 00:37)
|
|
Quellcode |
1 |
var random_xml = "top" + (1+Math.floor(Math.random()*3)) + ".xml"; |
|
|
Quellcode |
1 |
var random_xml = "top" + (Math.ceil(Math.random()*4)) + ".xml"; |
|
|
Quellcode |
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
<?php
// Creates 3 tables for each tour version
$iphone = array ('iphone.xml', 'iphone1.xml', 'iphone2.xml', 'iphone3.xml');
$random1 = $iphone[rand(0, 3)];
$android = array ('android.xml', 'android1.xml', 'android2.xml', 'android3.xml');
$random2 = $android[rand(0, 3)];
$flash = array ('flash_tour.xml','flash_tour1.xml','flash_tour2.xml','flash_tour3.xml');
$random3 = $flash[rand(0, 3)];
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<script src="js/tour.js"></script>
</head>
<body>
<div style="width:100%; height:400px; z-index:100; background-color:none;" data-role="none" id="pano">
<noscript>
<b>Attention:</b> <br/>
<br/>
Javascript is not activated. <br/>
<br/>
Please activate it to see the virtual tour <br/>
</noscript>
<script type="text/javascript">
var viewer = createPanoViewer({swf:"tour.swf", id:"krpanoSWFObject", target:"pano"});
//viewer.useHTML5("always");
if( viewer.isDevice("iPhone|iPod|iPad") )
{
viewer.addVariable("xml", "<?php echo $random1; ?>"); <!-- Returns a random xml from the variable $iphone -->
viewer.addVariable("showErrors", "false");
viewer.embed();
}
if( viewer.isDevice("Android") )
{
viewer.addVariable("xml", "<?php echo $random2; ?>"); <!-- Returns a random xml from the variable $android -->
viewer.addVariable("showErrors", "false");
viewer.embed();
}
else
{
viewer.addVariable("xml", "<?php echo $random3; ?>"); <!-- Returns a random xml from the variable $flash -->
viewer.addVariable("showErrors", "false");
viewer.embed();
}
</script>
</div> <!-- end of krpanoDIV -->
</body>
</html>
|
|
|
Quellcode |
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
<?php
// Création des tableaux pour le random
$iphone = array ('iphone.xml', 'iphone1.xml', 'iphone2.xml', 'iphone3.xml');
$android = array ('android.xml', 'android1.xml', 'android2.xml', 'android3.xml');
$flash = array ('flash_tour.xml','flash_tour1.xml','flash_tour2.xml','flash_tour3.xml');
?>
<!DOCTYPE html>
<html lang="fr">
<head>
</head>
<body>
<div style="width:100%; height:400px; z-index:100; background-color:none;" data-role="none" id="pano">
<noscript>
<b>Attention:</b> <br/>
<br/>
Javascript is not activated. <br/>
<br/>
Please activate it to see the virtual tour <br/>
</noscript>
<script src="js/tour.js"></script>
<script type="text/javascript">
var viewer = createPanoViewer({swf:"tour.swf", id:"krpanoSWFObject", target:"pano"});
//viewer.useHTML5("always");
if( viewer.isDevice("iPhone|iPod|iPad") )
{
viewer.addVariable("xml", "<?php echo $iphone[array_rand($iphone)]; ?>");
viewer.addVariable("showErrors", "false");
viewer.embed();
}
else if( viewer.isDevice("Android") ) <!-- Here I'd forgot the else if I was using else -->
{
viewer.addVariable("xml", "<?php echo $android[array_rand($android)]; ?>");
viewer.addVariable("showErrors", "false");
viewer.embed();
}
else
{
viewer.addVariable("xml", "<?php echo $flash[array_rand($flash)]; ?>");
viewer.addVariable("showErrors", "false");
viewer.embed();
}
</script>
</div> <!-- end of krpanoDIV -->
</body>
</html>
|