DOM style and classes

This demo covers Tripous helpers that work with inline style, computed style, display, visibility, CSS classes, and z-index. These helpers are intentionally small wrappers around normal browser DOM APIs. They accept either a selector or an element and they keep calling code consistent with the rest of the Tripous DOM helpers.

The first target shows style, display, and visibility changes. The second target is used only for class operations, so clearing classes does not destroy the layout of the whole demo. The two overlapping boxes show how z-index helpers move elements in front of or behind their siblings.

Inline and computed style

The buttons below operate on the target box. tp.SetStyle() and tp.StyleProp() write inline style. tp.StyleProp() also reads computed style when no value is passed. tp.StyleText() replaces the whole inline style text.

Style target

Display and visibility

tp.Visibility() changes the CSS visibility property. tp.Visible() changes the CSS display property. The test hides the same target briefly and then restores it, so the page remains usable.

CSS classes

Class helpers normalize strings and arrays of class names. This target is separate because tp.ClearClasses() removes every class from an element.

Class target

Z-index

tp.ZIndex() reads or writes z-index. tp.BringToFront() and tp.SendToBack() calculate a value based on sibling elements.

Blue box
Green box