could anybody kindly explain to me how should I work with CSS styles while creating the plugin? I’m writing the second plugin and i’m experiencing the behaviour like, all what has to be printed is printed but not every time the elements take its styles(classes or id styles) asigned to them.
For example now am building simple dynamic menu plugin. The structure is done, so the basic functionality is, all I’m fighting with is CSS. Everytime I refresh the page the menu changes. Sometimes it has all styles, sometimes it has nothing, sometimes it has just something. I’m not a coder, anyway I work in IT and am fast learning in pretty any logical thing. I assume the problem is in timing or rendering. Everything is printed as expected but it’s not just applied. Of course I can use direct styles on the element(which works as expected), but once I want to add hover function I have to append it to style node and here starts my problem. I know I can add it as mouseOver attribute directly on element, but this is really dirty work with very ugly code. Also using the header of plugin could be the solution, but that’s not dynamic.
So please what is wrong? or what are the best practices? I tried to slow down the code, but nothing help. Am not getting even bubbles preloading data. Even I preload it to instance.data, those are not accesible from INITIALIZE (ok, they are, but only on later action like user interaction with object), so in second plugin am using one-run time function in UPDATE. Which makes me feel am not doing aything properly.
My first plugin (Iconify Plugin) fails in it too. I’ve add the posibility make the icon rotate (for getting wide pallet of spinners accesible), but this solution simply does not work. The animation is staticly preset, but there is one dynamic value I need to add to style which is SCALE (scale is transform same as rotate, It has to be in one property). And because you can have several icons on the page the style should be asigned to corect one. In this plugin I had also the problem with rendering Icons in repeating group. Once the icons are dynamic, rendering is unpredictiable.
Thank you for all suggestions or clarifications.