工具提示不能根据窗口大小进行调整

Tooltip doesnot adjust according to window size

本文关键字:调整 窗口大小 不能 工具提示      更新时间:2023-09-26

我使用Tipped插件的工具提示..因为我之前使用的插件是ace admin pluginTipped,但问题是它没有根据窗口大小调整位置..在免费提示版本的一些功能不存在。我得到的主要问题是我在加载时设置了工具提示,在检查条件后,我试图改变它,但它显示了工具提示

代码:

var a=document.createElement('a');
a.setAttribute('id','23_34');
a.setAttribute('title', 'Transcription ID: ');  
 if (data == true) {
Tipped.remove("#23_45");
Tipped.create("#23_45", $('<p/>').html('Transcription ID:
}

,它显示两个工具提示不删除第一个…有人有解决方案或建议我任何工具提示,根据窗口高度自动调整其位置?

如果你不想使用任何插件的工具提示,只是CSS这个答案可以帮助。

HTML:

<a href="" class="tooltip_custom" data-title="text on hover"></a>
CSS:

.tooltip_custom{
    display: inline;
    position: relative;
}
.tooltip_custom:hover:after{ 
    background: #333; 
    background: rgba(0,0,0,.9); 
    border-radius: 5px; bottom: 26px; 
    color: #fff; font-size: 12.2px; 
    content: attr(data-title); 
    left: 113%; 
    bottom:-30%; 
    padding: 4px 7px; 
    position: absolute; 
    z-index: 500000000; 
    width: auto; 
} 
.tooltip_custom:hover:before{ 
    border: solid; 
    border-color: #333 transparent; 
    border-width: 6px 6px 0 6px; 
    bottom: 5px; 
    transform:rotate(90deg); 
    left: 100%; content: ""; 
    position: absolute; 
    z-index: 5000000001; }