【发布时间】:2018-06-03 15:28:24
【问题描述】:
JavaScript/jQuery 中是否有类似于 Liquid cycle 的函数,如下所述?
遍历一组字符串并按照它们作为参数传递的顺序输出它们。每次调用循环时,都会输出下一个作为参数传递的字符串。
输入:
{% cycle 'one', 'two', 'three' %}
{% cycle 'one', 'two', 'three' %}
{% cycle 'one', 'two', 'three' %}
{% cycle 'one', 'two', 'three' %}
输出:
one
two
three
one
【问题讨论】:
标签: javascript jquery iteration liquid cycle