Hi,
Last post of the day, promise.
I'd like to give several devices to the action "if", like this
if(isphone|ispad|istablet+flash, set(plugin[...].x, 0); set(plugin[...].y, 0); );
Could that be done?
Thanks.
Steph
Hi,
Last post of the day, promise.
I'd like to give several devices to the action "if", like this
if(isphone|ispad|istablet+flash, set(plugin[...].x, 0); set(plugin[...].y, 0); );
Could that be done?
Thanks.
Steph
I´d like to know that too
Thx and best regards
Nupsi
Hi,
at the moment there is no OR or AND inside an if(),
so it would be necessary to use several ifs to do such check,
but there is also an easy andvery simple solution for this kind of devices check:
first define a global variable, e.g. "mydevicecheck", for that devices situation and set it to true:
and then just check this variable in the if:
best regards,
Klaus
Hi Klaus,
Thanks for your suggestion. Noted!
Steph.
Looks very powerfull, Klaus! Could you please explain the "global variable" a little more? Did'nt knew such thing exists
Thanks and best regards
Nupsi
Hi Nupsi,
Global var in this case doesn't mean something special, you create a var that you can use in different ways or with different settings.
It's more understandable with the <events onclick="action();"/> var which is a global one. That means wherever you click the first time in your pano, the action set here will start.
Hope i've been clear enough.
Steph.
Hi,
I will try to explain too
QuoteCould you please explain the "global variable" a little more?
sorry, that 'global variable' is a term from programming, here it only means an variable that is globally available/accessible,
e.g. see here - these are the predefined global variables in krpano:
https://krpano.com/docu/actions/#globalvarsreference
defining a custom global variable is possible either by defining it at the <krpano> xml level (which is the 'global scope')...
e.g. either at the root <krpano> node:
or anywhere in the xml inside the <krpano> by defining an additionally <krpano> element, e.g.
... or by defining/creating it dynamically by 'setting' it,
e.g. in an action:
on the other side - 'non-global-variables' or 'local variables' in krpano are the variables from an specific object/element, e.g. the attributes from an <plugin> element, e.g. the "name", "width", "height" ... variables from <plugin> element are variables from the given plugin object,
to access an plugin local variable, the 'full path' to it, e.g. "plugin[name].width" need to be used - with only one exception - when the action code is called from an plugin event - then the local variables from this plugin object are directly accessible also without path, e.g. when doing: <plugin ... onclick="tween(width,100);" /> the local "width" variable of the current plugin element will be changed,
best regards,
Klaus
Your explanation is infinitely better than mine.
Thanks Klaus, i learnt too!
Hi,
the correct devices names are 'iphone' and 'ipad' (not isphone and ispad),
see here:
https://krpano.com/docu/xml/#devices-notes
e.g. devices="iphone|ipad"
best regards,
Klaus
Don’t have an account yet? Register yourself now and be a part of our community!