dowaw80220
2019-07-09 13:57
浏览 78
已采纳

我正在寻找创建一个函数来增加ACF循环中数据选择器的值

I'm working on a WP site with ACF (flexible content) and AOS.js

I'm trying to have the data-as-delay increment with each element added to the page.

I have tried wrapping everything in a <ul><li> but then I'd have to change all my CSS to accommodate. Since I'm trying to learn, I figured I'd try to create a function. But I don't know where to start.

<?php while ( have_rows('panneau') ) : the_row(); ?>
  <div class="col" data-aos="fade-right" data-aos-delay="200">
    <?php $image = get_sub_field('image'); if( !empty($image) ): ?>
      <img src="<?= $image['url']; ?>" alt="<?= $image['alt']; ?>" />
    <?php endif; ?>
  </div>
<?php endwhile; ?>

So I'd like every new img to have 200ms more delay!

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题