我的弹出窗口没有显示(Javascript / PHP)。怎么了?

时间:2016-03-01 12:21:39

标签: javascript php jquery dynamic popup

我已将弹出窗口与动态数据库相关联,但它并未显示。

我有这个带有PHP代码的Javascript:  

        <?php
        $r=mysql_query("select * FROM mynews where cmsid='359' and status='1' order by ordid");
        while ($m = mysql_fetch_array($r))
            {
        ?>
        $(document).ready(function() {
        $.fancybox(
        '<div style="width:800px">
        <h2 style="width:100%; text-align:center; margin-bottom:15px; color:#323742;"><?php echo $m["mytitle"]; ?></h2>
        <p><?php echo $m["mydescr"];?></p></div>',          {
                'autoDimensions'    : true,
                'transitionIn'      : 'none',
                'transitionOut'     : 'none'
                }


        <?php
        }
        ?> 

</script>

1 个答案:

答案 0 :(得分:0)

我认为你错过了关闭黄铜

<script type="text/javascript">
  <?php
    $r=mysql_query("select * FROM mynews where cmsid='359' and status='1' order by ordid");
    while ($m = mysql_fetch_array($r))
        {
    ?>
    $(document).ready(function() {
    $.fancybox(
    '<div style="width:800px">
    <h2 style="width:100%; text-align:center; margin-bottom:15px; color:#323742;"><?php echo $m["mytitle"]; ?></h2>
    <p><?php echo $m["mydescr"];?></p></div>',          {
            'autoDimensions'    : true,
            'transitionIn'      : 'none',
            'transitionOut'     : 'none'
            });
       });
    <?php
    }
    ?> 
  </script>