随机出现jQuery工具提示

时间:2015-06-18 12:01:23

标签: jquery random tooltip delay show

我正在开发这个"徽标颜色"。我点击后需要工具提示出现在ID为#show的DIV中(这是正常的)。但是在悬停按钮后,工具提示会出现在任何想要的位置。

在此处访问我的问题:http://web-stranky.org/pro_dementa/

$(document).ready(function () {
    $( document ).tooltip( {
        content:  function() {
            return  $( this ).attr( "title" );
        }
    });      
    $('button').click(function(){
        $('#show').html($('#' + $(this).attr('aria-describedby')).children().html());
    });
});

1 个答案:

答案 0 :(得分:0)

您尚未加入jquery-ui.css。只需将其添加到文档中,一切都会好的!

您可以从 here

获取

<强>更新

如果您在div中需要它,html也添加title属性,如下所示从其他元素中删除title属性

$('#show').html($('#' + $(this).attr('aria-describedby')).children().html());

$('#show').attr('title',$('#' + $(this).attr('aria-describedby')).children().html()); //add this