Sie sind nicht angemeldet.

jordi

Profi

  • »jordi« ist der Autor dieses Themas

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

1

Dienstag, 26. September 2017, 13:47

url attribute

Should not it be almost the same ?

Quellcode

1
2
3
4
5
6
7
8
9
10
set(thumbS.url.flash,%SWFPATH%/plugins/scrollarea.swf);	
set(thumbS.url.html5,%SWFPATH%/plugins/scrollarea.js);
	
-----------

if(device.html5, 
	set(thumbS.url,%SWFPATH%/plugins/scrollarea.js);
	,
	set(thumbS.url,%SWFPATH%/plugins/scrollarea.swf);		
);


The first one is not working
everpano.com step beyond 360

2

Dienstag, 26. September 2017, 19:49

Hi,

the first one is invalid syntax.

That '.html5' and '.flash' are device checks for xml attributes:
https://krpano.com/docu/xml/#devicechecksforattributes

That can be used only in static xml code when defining attributes - when the check will fit the device, then that attribute will be parsed, otherwise it will be skipped/ignored.

For dynamic code an if() action or the calc() action with the if ? then-value : else-value operator could be used.

E.g. build the url this way - use the base path and file and depending on html5 or flash add 'js' or 'swf' to the filename:

Quellcode

1
calc(thumbs.url, '%SWFPATH%/plugins/scrollarea.' + (device.html5 ? 'js' : 'swf'));


Best regards,
Klaus

jordi

Profi

  • »jordi« ist der Autor dieses Themas

Beiträge: 583

Wohnort: Barcelona

Beruf: creating ideas & coding them

  • Nachricht senden

3

Mittwoch, 27. September 2017, 09:17

Great,
thanks for the advice *thumbsup*
everpano.com step beyond 360