对于我的 php 动态驱动的网站mobileapps.co,它正在从数据库中提取产品。我还在运行 jquery 来为每个产品创建气泡弹出窗口。
如何为所有产品循环我的 javascript,我正在使用以下代码
<ul>
<script>
$(document).ready(function() {
$('.popup0').CreateBubblePopup({
position: 'top',
align: 'center',
innerHtml: '<?php echo $result['
embeddedcode ']; ?><p style="float:left"><?php echo substr($result['
appdesc '], 0, 100); ?><img src="images/rate-off.gif" /><img src="images/rate-off.gif" /><img src="images/rate-on.gif" /><img src="images/rate-on.gif" /><img src="images/rate-on.gif" /></p>',
innerHtmlStyle: {
color: '#FFFFFF',
'text-align': 'center'
},
themeName: 'all-black',
themePath: 'images/jquerybubblepopup-theme'
});
});
</script>
<?php foreach ($fetchapps->arr as $result): ?>
<li id="app-<?php echo $result['appid']; ?>" class="popup0">
<div class="icon">
<a href="app-details.php?result=<?php echo $result['appid']; ?>"><?php echo $result['embeddedcode']; ?></a>
</div>
<p>
<a href="app-details.php?result=<?php echo $result['appid']; ?>"><?php echo substr($result['apptitle'], 0, 15); ?></a>
<span><a href="app-details.php?result=<?php echo $result['appid']; ?>"><?php echo $result['category']; ?></a></span>
<strong><?php if($result['appprice'] != 'free') echo $result['appprice']; ?></strong>
<b><?php if($result['appprice']!='free'){ ?>$.<?php } ?><?=$result['appprice']?></b>
</p>
</li>
<?php endforeach; ?>
</ul>