简体   繁体   English

鼠标悬停在另一个图像/链接上时如何显示新图像/窗口

[英]How to display a new image/window when rollover another image/link

I know this will be an easy one for you guys but I couldn't figure out how to do something like this; 我知道这对你们来说很容易,但是我不知道该怎么做。 http://backpack.tf/ http://backpack.tf/

On that page, when you take your mouse to any item it opens a new small window displaying some text/image. 在该页面上,将鼠标移至任何项目时,它将打开一个新的小窗口,其中显示一些文本/图像。 What are my options for achieving something like that? 要实现这样的目标,我有哪些选择? JavaScript? JavaScript? I tried using "onMouseOut=" with HTML but it is too simple for what I have in mind. 我尝试将“ onMouseOut =“与HTML结合使用,但是对于我而言,它太简单了。

I'd be tempted to say this is almost certainly a duplicate: Is there a JQuery tooltip plugin that supports HTML content and automatically positions tooltips? 我很想说这几乎是重复的: 是否有一个支持HTML内容并自动定位工具提示的JQuery工具提示插件? . To name but one :) 仅举一个:)

Either way you should look at tooltips, a quick google search found this: 无论哪种方式,您都应该查看工具提示,通过Google的快速搜索可以找到以下内容:

http://jqueryui.com/tooltip/ http://jqueryui.com/tooltip/

It should let you use html content inside the tooltop. 它应该让您在工具栏内使用html内容。

you can use Hover event in jQuery or javascript whatever you like and in that even write your code whatever you want to achieve etiher showing block or displaying image:- 您可以根据需要在jQuery或javascript中使用Hover事件,甚至可以通过编写代码来实现显示块或显示图像的目的:

$("#idOfElement").on("hover", function()
{
    ////your code
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM