Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.
|
|
Quellcode |
1 2 |
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css"> <link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css"> |
Zitat
<events onloadcomplete="delayedcall(4, hideloader() ); set(events.onloadcomplete,null); set(autorotate.enabled,true);" />
<plugin name="description"
url="description/courtyard_day.png"
visible="false"
enabled="false"
align="bottom"
y="50"
zorder="999"
/>
thanks a lot patrick..
to b more specific
Zitat
<events onloadcomplete="delayedcall(4, hideloader() ); set(events.onloadcomplete,null); set(autorotate.enabled,true);" />
<plugin name="description"
url="description/courtyard_day.png"
visible="false"
enabled="false"
align="bottom"
y="50"
zorder="999"
/>
thats what i load, now what if i want to show courtyard_day-L.png if found landscape or courtyard_day-P.png if found portrait orientation?
Also
could you guide for code ?
am really very new to krpano.
thanks in advance
|
|
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 |
<!-- use this in your well-formed HTML document -->
<script type="text/javascript">
function getOrientation()
{
var orientation = window.orientation;
//returns either 0, 90, or -90
function krpano()
{
return document.getElementById("krpanoSWFObject");
}
//annoying browser alert, for testing:
alert(" orientation=" + orientation);
//trace function inside krpano for testing:
krpano().call("trace("+ orientation +");");
//the real deal:
krpano().call("useOrientation("+ orientation +");");
}
</script>
<!-- adjust the below html to suit however you normally embed panos. note you must have the ID attribute in there -->
<div id="pano" style="width:100%; height:100%;">
<script>
embedpano({swf:"someswf.swf", id:"krpanoSWFObject", xml:"somexml.xml", target:"pano"});
</script>
</div>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<!-- your onloadcomplete handler: -->
<events onloadcomplete="delayedcall(4, hideloader() ); set(events.onloadcomplete,null); set(autorotate.enabled,true);
checkOrientation();" />
<!-- new stuff: -->
<action name="checkOrientation">
<!-- call javascript function in html -->
js(getOrientation);
</action>
<action name="useOrientation">
trace("my orientation is: ", %1);
<!-- do something here based on the value of 0, 90, or -90 -->
</action>
<!-- end -->
|
...good reference: http://krpano.com/docu/actions/#js and A Tutorial on Krpano Action Arguments (pt 1) ) Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comSo when i understand right (for dummy's):
you can make a different skin for when the device is in landscape situation..
that flips to the portrait skin when device goes to portrait situation?
|
|
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 |
<script type="text/javascript">
function getOrientation()
{
var orientation = window.orientation;
//returns either 0, 90, or -90
function krpano()
{
return document.getElementById("krpanoSWFObject");
}
try {
var myDivClass = "rotated";
switch(orientation){
case 0:
//call function in krpano xml, w/orientation passed as variable
krpano().call("useOrientation("+ orientation +");");
break;
case -90:
krpano().call("useOrientation("+ orientation +");");
break;
case 90:
krpano().call("useOrientation("+ orientation +");");
break;
}
//or do something to the Web page itself:
document.getElementById("pano").setAttribute("class", myDivClass+orientation);
}
catch(e) {
krpano().call("trace(ERROR:"+ e.message +");");
alert('ERROR:' + e.message);
}
}
</script>
<!-- end -->
|
|
|
Quellcode |
1 2 3 4 5 |
//javascript:
window.onorientationchange = function() {
//do interesting things here, to the Web page or krpano pano
alert(window.orientation);
}
|
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comi would like to see a nice simple example and code with some different things..that makes the js and xml work together with this..
Tuur![]()
Benutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.comBenutzerinformationen überspringen
Wohnort: Netherlands
Beruf: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer
: https://pame.virtualtuur.com