【问题标题】:Jquery tooltip customization isnot working, how to handle it?jQuery工具提示自定义不起作用,如何处理?
【发布时间】:2019-09-08 14:21:03
【问题描述】:

我正在尝试使用 jquery 自定义我的工具提示。定位和添加一些效果,还可以定制一点设计。工具提示已正确显示,但是当我尝试添加一些效果或定位时,没有任何反应。

我试试这个:

$(".tip").tooltip(
{
    show: { delay: 4000, effect: 'slide' },
    hide: { delay: 4000, effect: 'slide' }
});

或者这个:

$(".tip").tooltip({
        position: { my: "left+15 center", at: "right center" }
    });

这是我实际得到的代码

<script src="~/Scripts/jquery-3.3.1.js"></script>
<script src="~/Scripts/jquery-ui-1.12.1.js"></script>
<script src="~/Scripts/jquery-SortTable.js"></script>
<link href="~/Content/themes/base/jquery-ui.css" rel="stylesheet"type="text/css" />
<script src="~/Scripts/bootstrap.min.js"></script>
<script>
    $(function () {
        $(".tip").tooltip({
            show: { delay: 4000, effect: 'slide' },
            hide: { delay: 4000, effect: 'slide' }
        });
   });
</script>

我想要至少 css 和效果工作,但遗憾的是没有发生任何事情。

【问题讨论】:

    标签: jquery asp.net vb.net jquery-ui jquery-ui-tooltip


    【解决方案1】:

    试试这个

    <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
      <link rel="stylesheet" href="/resources/demos/style.css">
      <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
      <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    
    
    
      $( ".selector" ).tooltip({  
        hide: { effect: "explode", duration: 1000 }
        show: { effect: "blind", duration: 800 }
        });
    

    【讨论】:

    • 我尝试了这个,但不幸的是它并没有改变任何东西。
    • $(function() { $('.tip').tooltip({ items: 'a.tip', content: 'Test content…', show: "slideDown", close: function(event, ui) { ui.tooltip.hover(function() { $(this).stop(true).fadeTo(500, 1); }, function() { $(this).fadeOut('500', function() { $(this).remove(); }); }); } }); });
    • 试试上面的代码看看有什么效果请添加你可以在我的回答中看到的jquery链接
    猜你喜欢
    • 1970-01-01
    • 2020-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-24
    • 1970-01-01
    • 2020-09-23
    相关资源
    最近更新 更多