jquery - 如何在 JQuery 中打开具有相同类的单独工具提示

标签 jquery html css tooltip jquery-ui-tooltip

我正在学习 JQuery,为此我做了这项工作。当我将鼠标悬停在缩略图上时,我遇到了问题,所有工具提示都打开了,我只想打开相关的工具提示,我不想为此使用多个类,我想用相同的类来完成这项工作。有没有什么方法可以在不为每个缩略图单独类的情况下完成这项工作?

这是链接:http://shahfahad.com/jquery/hide-show.html

enter image description here 检查随附的屏幕截图

最佳答案

试试这个脚本

<script>
$(document).ready(function(){
    $(".model").css("display","none");  
        $(".hide").click(function(){
        $(".show").closest("ul").removeClass("showing");
        $(".model").hide();

    }); 

    $(".show").mouseover(function(){

        if(!$(this).closest("ul").hasClass("showing")){
        $(this).closest("ul").addClass("showing");
        $(this).next(".model").show(); 
        }
    });

});

fiddle

关于jquery - 如何在 JQuery 中打开具有相同类的单独工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48090090/

相关文章:

javascript - 从 jQuery 中的对象数组中提取单个属性的每个值

python - 在 Beautifulsoup Python 上排除不需要的标签

html - 如果 4 + 8 = 12 那么为什么我的 bootstrap 网格仍然溢出页面的边缘?

javascript - 粘性导航栏的响应取决于滚动

javascript - Bootstrap slider 始终返回 "10"

jquery - KendoUI 可观察对象 : Set multiple attributes

html - 影响其他元素的类的 CSS 属性

css - 如何在不影响字体大小的情况下降低文本的高度?

html - 如何在网站上放置书签图标(favicon)

javascript - 使用 jQuery UI 和 jPlayer 控制音频