【问题标题】:Popover or Tooltip doesn't work at all in my browser弹出框或工具提示在我的浏览器中根本不起作用
【发布时间】:2015-06-21 19:28:12
【问题描述】:

我整天都在尝试在我的表格中添加一些弹出框,以显示每个单元格的更多信息。但我得出结论,弹出框在我的代码中根本不起作用。如何和为什么?有人知道它是什么吗?

<td>
        <div>
                <span class="btn" id="infoItem" data-toggle="popover" rel="popover">
                    <?php echo $row[0] ?>
                </span>
                <script>
                    $(document).ready(function() {
                        $('[data-toggle="infoItem"]').popover({
                            html: true,
                            animation: false,
                            content: <?php echo $row[0] ?>,
                            placement: "bottom"
                        });
                    });
                </script>
            </div>
    </td>

现在我只是在弹出框中显示与单元格中相同的信息。信息显示在单元格中,因此弹出框不为空。

【问题讨论】:

    标签: php html twitter-bootstrap popover


    【解决方案1】:

    这里是working JS Fiddle

    $(document).ready(function() {
        $('[data-toggle="popover"]').popover({
            html: true,
            animation: false,
            content: 'World',
            placement: "bottom"
        });
    });
    

    【讨论】:

    【解决方案2】:
    i realized you are missing some quotes '' and a semi colon on your script
    
    <td>
            <div>
                    <span class="btn" id="infoItem" data-toggle="popover" rel="popover">
                        <?php echo $row[0]; ?>
                    </span>
                    <script>
                        $(document).ready(function() {
                            $('[data-toggle="infoItem"]').popover({
                                html: true,
                                animation: false,
                                content: '<?php echo $row[0]; ?>',
                                placement: "bottom"
                            });
                        });
                    </script>
                </div>
        </td>
    

    【讨论】:

      猜你喜欢
      • 2013-08-26
      • 2014-09-18
      • 2014-08-16
      • 1970-01-01
      • 1970-01-01
      • 2017-01-17
      • 1970-01-01
      • 2018-07-31
      • 2021-02-22
      相关资源
      最近更新 更多