Sie sind nicht angemeldet.

1

Montag, 27. August 2018, 18:20

Assign CSS IDs and Classes to arbitrary layers / plugins?

all divs in krpanos html output are styled inline without any use of IDs or classes.

layer / plugin names given in XML codes aren't available in the outputted code.

i didn't find a way to assign a class or ID to a layer element of my skin.
i need that to get access from outside of krpano for styling and/or injecting content changes with jquery.
any help available for this problem?

thanks thomas
----------------------------------
thomas bredenfeld

http://panoramabuch.com
http://bredenfeld.com

2

Dienstag, 28. August 2018, 09:02

Hi,

the sprite property links to the the internal div element a layer element (or a hotspot element defined with renderer="css3d"):
https://krpano.com/docu/xml/#layer.sprite

Here an example to access it and set some custom CSS property:
https://krpano.com/forum/wbb/index.php?p…76225#post76225

The same could do also done to set the CSS id:

Quellcode

1
2
3
4
5
6
7
<action name="set_css_id" type="Javascript">
  caller.sprite.id = args[1];
</action>

<layer ...
    onloaded="set_css_id('my_css_id');"
    />


or to add CSS classes by using className,

or do all that directly via JS from external by using the JS-APIs:
https://krpano.com/docu/js/#top

But when using custom CSS styles avoid changing the sizes in any way, that could break the layout - and note that some css properties will be set/used already by krpano itself.

Best regards,
Klaus

3

Dienstag, 28. August 2018, 16:36

danke vielmals klaus,
ich denke, das wird mir erstmal helfen :-)
lg thomas
----------------------------------
thomas bredenfeld

http://panoramabuch.com
http://bredenfeld.com