Ptrckk
Members
-
Joined
-
Last visited
Reputation Activity
-
Ptrckk reacted to BrowserBugs in Database displays multiple timesThe foreach is in the wrong place, you want to loop the <li> and not the whole thing. The following should work.
<?php include_once 'handler.php'; $teams = getTeams(); ?> <link href="jquery_news_ticker/styles/ticker-style.css" rel="stylesheet" type="text/css" /> <script src="jquery_news_ticker/includes/jquery.ticker.js" type="text/javascript"></script> <ul id="js-news" class="js-hidden"> <?php foreach ($teams as $team) { $leden = getLeden($team["id"]); ?> <li class="news-item"><a href="#"><?php echo $team ["telefoon"]; ?></a></li> <?php } ?> </ul> <script type="text/javascript"> $(function () { $('#js-news').ticker(); }); </script>