【问题标题】:Tooltipser popup not working for the first mouse overTooltipser 弹出窗口不适用于第一个鼠标悬停
【发布时间】:2014-04-08 08:15:16
【问题描述】:

我在我的页面中使用 Tooltipser 弹出窗口。

并且tooltipser的内容是通过ajax更新的。

如果内容中没有图像,它们运行良好。

但是如果ajax内容中有图片,那么第一次tooltipser的位置是不正确的。 但从第二次开始,它出现在正确的位置(即在顶部位置)

有人知道原因吗?

以下是我的代码

<script>

$(document).ready(function() {
$('#test_link').tooltipster({
    interactive:true,   
    content: 'Loading...',
    functionBefore: function(origin, continueTooltip) {

        // we'll make this function asynchronous and allow the tooltip to go ahead and show the loading notification while fetching our data
        continueTooltip();

        // next, we want to check if our data has already been cached
        //if (origin.data('ajax') !== 'cached') {
            $.ajax({
                type: 'POST',
                url: 'example.php',
                success: function(data) {
                    // update our tooltip content with our returned data and cache it
                    origin.tooltipster('content', $(data)).data('ajax', 'cached');
                }
            });
      //  }
    }
});
     });
    </script>

example.php

<?php
echo "<img src='flag.jpg'>";
?>

【问题讨论】:

    标签: jquery tooltipster


    【解决方案1】:

    这在 github 问题列表中得到了解答。 https://github.com/iamceege/tooltipster/issues/111

    【讨论】:

      猜你喜欢
      • 2022-12-19
      • 1970-01-01
      • 2010-11-02
      • 2016-09-23
      • 1970-01-01
      • 1970-01-01
      • 2014-05-14
      • 2011-08-22
      • 2020-09-20
      相关资源
      最近更新 更多