1

我的 Fancybox 有问题,我正在尝试检索一些 php 数据,但没有正确重新加载,我使用 firebug 跟踪页面上的活动,似乎实际上是从我的数据库中检索正确的数据但是Fancybox 不解析该信息,它只显示第一个值。这是我的幻想箱

$(document).ready(function() {
$(".various").fancybox({
    fitToView   : false,
    width       : '70%',
    height      : '70%',
    autoSize    : true,
    closeClick  : false,
    scrolling   : 'auto',
    titlePosition     : 'inside',
    openEffect  : 'fade',
    closeEffect : 'fade',
    type : 'inline'
}



});
});

这是我的一段 php 代码,我在检索 $value['managementSummary'] 时遇到问题:

echo '<td><p class="various" href="#inline" title="Reference ID # ' . $referenceId . '">' .$value['managementSummary']. ' ...(+)';  
echo '<div style="display: none;"><div id="inline" style="width:400px;height:200px;overflow:auto;"> '. $value['managementSummary'] .'  </p></td></div>';

我知道我必须使用某种功能刷新我的内容,例如:

beforeLoad : function() {
this.content = '. $value['managementSummary'] .';

当然它不起作用,有什么想法吗???谢谢!!!

4

1 回答 1

0

所以我能够解决这个问题,我在我的 fancybox 调用中使用了这个代码:

afterLoad: function(){
                this.content = $(this.element).attr('rel');
            }

我也更改了我的 php 代码:

echo '<td><p>' .truncate($value['managementSummary']). ' <a href="#inline" class="various" rel="'. $value['managementSummary'] .'" title="Reference ID # ' . $referenceId . '">...(+)</a></p></td>';
echo '<div id="inline" style="width:400px;height:200px;display:none;"> '. $value['managementSummary'] .'  </div></td>';

奇怪的是我的内容没有以正确的方式显示,所以我使用了不同的 div 属性“Rel”来解析我的解决方案。

于 2013-04-03T14:41:24.240 回答