Sie sind nicht angemeldet.

1

Freitag, 12. Mai 2017, 21:15

style.desktop=" " don't working

I was using in previous version of krpano (1.18) this contruction

Quellcode

1
2
3
<layer name="layer1" style.desktop="style1" style.mobile="style2"/>
<style name="style1" some parameters.../>
<style name="style2"some paprameters.../>


and now it's not working! How can i split styles for different platforms? I need different parameters and css styles for mobile and desktop.

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

2

Freitag, 12. Mai 2017, 22:32

Try change order:

Quellcode

1
2
3
<style name="style1" some parameters.../> 
<style name="style2"some paprameters.../>
<layer name="layer1" style.desktop="style1" style.mobile="style2"/> 


Best ragards
Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

3

Samstag, 13. Mai 2017, 14:21

No, this solution not working to (

Beiträge: 1 117

Wohnort: Poland, Europe

Beruf: krpano developer : virtual tours : the cms4vr owner

  • Nachricht senden

4

Samstag, 13. Mai 2017, 19:05

Sorry...
It should be like this:


Quellcode

1
2
3
4
<style name="style1" some parameters.../> 
<style name="style2" some paprameters.../>
<layer name="layer1" style.mobile="style2"/> 
<layer name="layer1" style.desktop="style1" /> 



best regards
Piotr
Your own professional, online cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube :: wiki.cms4vr.com

cms4vr team *thumbsup*

5

Montag, 15. Mai 2017, 17:49

Some tests

I've made some test scenes:

XML of the scenes: http://3dvr.mir-360.ru/krpanotest/vrtr.xml


Version 19 pr.10 -
http://3dvr.mir-360.ru/krpanotest/index.html

Results: Desktop - http://take.ms/eCuvW
Mobile - http://take.ms/DD7wS

Layer parameters works perfectly, but styles - not! (

Version 18_06 -
http://3dvr.mir-360.ru/krpanotest/index2.html

Results: Desktop - http://take.ms/gKPVU
Mobile - http://take.ms/LnDqK
All works perfectly. There was a post about some changes in <style>: https://krpano.com/forum/wbb/index.php?p…1294#news119xml
But as i understand, there is no something about devices check.
And i still can't get it working. *confused*

6

Dienstag, 16. Mai 2017, 09:30

why do you do it this way?

just apply one style for all device types and then in the style use .desktop, .mobile for the properties
like this you can easy add tablet support or other conditions, all with a simple setup and one style only.

<style name="example" width.desktop="300" width.mobile="400"/>
<layer name="layer1" style="exampe" .... />

if you have a different setup for the layer you can do

<layer name="layer1" style="example" if="device.desktop" .... />
<layer name="layer1" style="example" if="device.mobile" .... />

index

7

Mittwoch, 17. Mai 2017, 14:20

Hi,

the reason is the 'style' behavior change in the release 1.19-pr3:
krpano 1.19 - Pre Release 3

Before that release, the 'style' attribute was a normal attribute of the layer and hotspots elements - like any other attribute. And therefore also the xml attribute-device-checks could be used on them.

But with the release 1.19-pr3 the 'style' attribute had become a 'special' attribute for all xml elements. Instead of checking the style when creating/building an layer or hotspot, the xml parser of krpano checks the style already during the xml parsing. So that styles get applied (=attributes copied from the related <style> elements) before parsing/adding the normal attributes from the xml element. This allowed it to overwrite attributes that were already defined in the <style> by the attributes that were defined at the xml element itself.

And because of the new special nature of the 'style' attribute, adding device-checks directly to it, is not possible anymore.
But I will check if that could be added again.

Best regards,
Klaus