Wijmo UI for the Web
Style Based on State
Show AllShow All
Hide AllHide All

Building on the Quick Start example, you can change the colors and styles of each element in the tree using CSS styling. For available tree CSS selectors, see the jquery.wijmo.wijtree.css file in your installation folder.

  1. In the <head> section of your HTML file, above the script to initialize the widget, add the following style which changes the background color for elements of the Tree depending on whether they are in hover state or active state, and changes the font weight when a node is in expanded state. 

    Drop down and copy styles to paste in <head> section

  2. No changes are necessary in the script section of your HTML file. The basic script is sufficient to create the tree.
  3. In the <body> section of your HTML file, replace the simple unordered list with this markup that includes more tree nodes, which allows you to see multiple states at once more easily.

    Drop down and copy markup to paste in <body> section

  4. Save your HTML file and open it in a browser. The widget appears like the one in the live widget below. Click different nodes to expand and contract them and hover over nodes to see the different styles applied.

See Also

Concepts

Widgets

Reference

 
Support Options