Svija draws pages in the following order:
- page
- components
Both pages and components can contain sub-elements, loaded in the following order:
- javascript (in the head)
- CSS
- SVG + HTML + form
- javascript (in the body)
Z Index: Components
Components have a setting called Z index that determines the order in which they are drawn.
- Components with a low Z index are drawn first, and are behind
- Components with a high Z index are drawn last, and are in front
Changing the Z index of a component moves it backwards and forwards among other components, but never behind a page.
NOTE: when a component is included via page settings, the Z Index set there overrides the component’s original Z Index.
The Z index must be between 0 and 32767.
Load Order: Scripts Included with Other Elements
Pages, Script Sets and Components can contain scripts. These are included in the following order:
- javascript in the head
- CSS
- SVG + HTML + form
- javascript in the body
The overall groups never change order, but within each group the order of inclusion is:
- scripts associated with a Page
- scripts associated with Script Sets
- scripts associated with Components
For example:
- CSS code in page settings will be applied before CSS code in component settings
- the SVG and HTML associated with a page will be behind the SVG and HTML of a component
A Dive into the Weeds
Scripts associated with pages, script sets and components stay together.
For example, the “Body JS” scripts included with a component are:
- ordered amongst themselves using the Load Order setting
- executed before or after other component’ scripts according to the parent component’s Z Index