You are not logged in.

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.

1

Monday, August 27th 2018, 6:20pm

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

Tuesday, August 28th 2018, 9:02am

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:

Source code

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

Tuesday, August 28th 2018, 4:36pm

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

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