Return to v2.3 docs


View Helpers Miscellaneous Functions string controller

Cycles through list values every time it is called.

Name Type Required Default Description
values string Yes List of values to cycle through.
name string No default Name to give the cycle. Useful when you use multiple cycles on a page.
<!--- Alternating table row colors --->
		<cfoutput query="employees">
			<tr class="#cycle("odd,even")#">

<!--- Alternating row colors and shrinking emphasis --->
<cfoutput query="employees" group="departmentId">
	<div class="#cycle(values="even,odd", name="row")#">
				rank = cycle(values="president,vice-president,director,manager,specialist,intern", name="position")>
				<li class="#rank#">#categories.categoryName#</li>

Related Functions

Miscellaneous Functions