Websites built by the framework, for example, divided into four parts: top, bottom, left, and right. The selected column needs to be highlighted. When you click a column, only the content on the right is changed, others are not changed, so in
Websites built by the framework, for example, divided into four parts: top, bottom, left, and right. The selected column needs to be highlighted. When you click a column, only the content on the right is changed, others do not change. Therefore, if you cannot obtain the column value on the left side, use js to control it.
1 2 3 4 5 6 7
|
$ (Document). ready (function (){ $ (". Channel: first"). addClass ("color "); $ (". Channel"). click (function (){ $ (". Channel"). removeClass ("color "); $ (This). addClass ("color "); }); }); |
This is the code controlled by js. The. channel is all columns, and The. color is the highlighted style. This is really an example. It is not easy to write, just laugh !!