我正在开发这个“徽标颜色”。 我需要工具提示出现在DIV中,其中id是#show点击后(这是正常的)。 但是在悬停按钮后,工具提示会出现在任何想要的位置。
请访问我的问题: 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()); }); });I am developing this "logo colors". I need the tooltip to appear in a DIV where id is #show after I click (this is OK). But after hover the buttons the tooltip is appearing anywhere it wants.
Visit my problem here: 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()); }); });最满意答案
你还没有包括jquery-ui.css 。 只需将其添加到文档中,一切都会好的!!
你可以从这里得到它
UPDATE
如果你在div中需要它,还有html添加title属性,如下所示从其他元素中删除title属性
$('#show').html($('#' + $(this).attr('aria-describedby')).children().html()); $('#show').attr('title',$('#' + $(this).attr('aria-describedby')).children().html()); //add thisYou have not included jquery-ui.css. Just add it in document and everything will be fine!!
You can get it from here
UPDATE
If you need it in the div the along with html add title attribute too and as below remove the title attribute from other elements
$('#show').html($('#' + $(this).attr('aria-describedby')).children().html()); $('#show').attr('title',$('#' + $(this).attr('aria-describedby')).children().html()); //add this更多推荐
发布评论