Du brauchst für einen eineindeutigen Selektor sowohl ID als auch Count:
Code:
<?= $this->id.'_'.$i; ?>
<?= $this->id.'_'.$i; ?>
<?php foreach($this->group('grafikbalken') as $i => $fields): ?>
<?php $GLOBALS['TL_HEAD'][] = "<style>.ce_chart_" . $this->id.'_'.$i . ".start .chart_data{width: " . $this->field('procent#'.$i)->value() . "%;}</style>";?>
<div class="ce_chartbar block ce_chart_<?php echo $this->id.'_'.$i; ?> slim" <?php echo $this->cssID; ?> <?php if ($this->style): echo $this->style; endif; ?>>
<div class="ce_chart_inside">
<div class="title"><?php echo $this->field('title#'.$i)->value(); ?></div>
<div class="chart_bg">
<div class="chart_data bg-accent"><span><?php echo $this->field('procent#'.$i)->value(); ?>%</span></div>
</div>
</div>
</div>
<script>
/* <![CDATA[ */
jQuery(document).ready(function(){
setTimeout(function() {
jQuery('.ce_chart_<?php echo $this->id.'_'.$i; ?>').waypoint(function(direction) {
jQuery('.ce_chart_<?php echo $this->id.'_'.$i; ?>').addClass('start');
},{offset: '90%',triggerOnce: true});
}, 500);
});
/* ]]> */
</script>
<?php endforeach; ?>
Kommentar