Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 2 |
<link rel="stylesheet" media="all and (orientation:portrait)" href="portrait.css"> <link rel="stylesheet" media="all and (orientation:landscape)" href="landscape.css"> |
Quoted
<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
Quoted
<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
|
|
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 |
<!-- 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>
|
|
|
Source code |
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) ) So 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?
|
|
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 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 -->
|
|
|
Source code |
1 2 3 4 5 |
//javascript:
window.onorientationchange = function() {
//do interesting things here, to the Web page or krpano pano
alert(window.orientation);
}
|
i 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![]()