我正在尝试让 Jcycle2 的渐进式加载脚本与我的 ACF 字段一起使用。问题是,渐进式加载脚本使用 JSON,我不知道如何实现我的 php。
从 Jcycle2 网站:
<div class="cycle-slideshow auto"
data-cycle-fx=scrollHorz
data-cycle-timeout=2000
data-cycle-caption=".caption1"
data-cycle-caption-template="{{slideNum}} / 9"
data-cycle-loader=true
data-cycle-progressive="#images"
>
<!-- only one image declared in markup -->
<img src="http://malsup.github.io/images/beach1.jpg">
<!--
JSON array of slides to be loaded progressively,
nested inside a script block. The script block does not need
to be inslide the slideshow container, it can be anywhere on the
page. Note the type on the script tag.
-->
<script id="images" type="text/cycle">
[
"<img src='http://malsup.github.io/images/beach2.jpg'>",
"<img src='http://malsup.github.io/images/beach3.jpg'>",
...
"<img src='http://malsup.github.io/images/beach9.jpg'>"
]
</script>
</div>
理想情况下,我希望该<script>
部分成为我的 ACF 中继器中的图像列表。这有可能吗?