jQuery Jquery在悬停时创建一个弹出式div?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1563481/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 11:43:44  来源:igfitidea点击:

Jquery to create a popup div on hover?

jquery

提问by cannyboy

Thisis a pretty cool jquery popup technique for an image. Does anyone know the best way to get a similar thing working to get a div-enclosed table as the pop-up? What I'm trying to do is let the user hover over an image to get a bigger version of the image plus a caption and other details.

是一个非常酷的 jquery 图像弹出技术。有没有人知道让类似的东西工作以获得一个 div 封闭表作为弹出窗口的最佳方法?我想要做的是让用户将鼠标悬停在图像上以获得更大版本的图像以及标题和其他细节。

回答by Sergey

I think that's pretty simple just use Jquery.mouseover(fn)

我认为这很简单,只需使用 Jquery.mouseover(fn)

$("#yourimage").mouseover(function() {
    $("#hidden_div").show();
}).mouseout(function() { 
    $("#hidden_div").hide();
});

回答by finneycanhelp

hover in jquery exists too: Jquery.hover(fn,fn)

在 jquery 中悬停也存在:Jquery.hover(fn,fn)

See http://api.jquery.com/hover/

http://api.jquery.com/hover/