【发布时间】:2014-02-22 21:45:22
【问题描述】:
我在显示推荐的“重复区域”中使用 Bootstrap 弹出框。每个推荐都有一个“查看属性详细信息”按钮,可以打开弹出框。在弹出窗口中,我想显示与每个推荐和图像细节相关的图像。图像路径存储在数据库的列中,因此要显示每个推荐的图像,我需要将图像源绑定到内容,但它不接受 PHP。我正在使用一个脚本,该脚本允许我将 html 写入内容,但需要动态创建图像。动态文本适用于“a”标签“标题”选项,但不适用于内容。
有人能解释一下吗?
这就是我所拥有的。
<script type="text/javascript">
$(document).ready(function() {
$("[rel=details]").popover({
placement : 'bottom', //placement of the popover. also can use top, bottom, left or right
html: 'true', //needed to show html of course
content : '<div id="popOverBox"><img src="<?php echo $row_rsTstmnlResults['image']; ?>" width="251" height="201" /></div>' //this is the content of the html box. add the image here or anything you want really.
});
});
</script>
<a href="#" rel="details" class="btn btn-small pull-right" data-toggle="popover" title="<?php echo $row_rsTstmnlResults['property_name']; ?>" data-content="">View Property</a>
【问题讨论】:
标签: javascript php jquery twitter-bootstrap popover