如何使用jQuery将鼠标悬停在图标上时显示简单的文本框 [英] How to show a simple textbox when I hover over an icon using jquery

查看:807
本文介绍了如何使用jQuery将鼠标悬停在图标上时显示简单的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在字段旁边有一个html输入字段和一个帮助图标(?),
当我将鼠标悬停在图标上时,我希望显示一条简单的文本消息,并且文本消息在悬停时消失远。
任何方式使用jQuery来做到这一点?



图标将是一个简单的图像,说一个小问号。
文本将是在框中输入你的名字。 您可以使用tooltip在图标上显示鼠标的文本,



这是一个很好的例子。

http:// www.alessioatzeni.com/blog/simple-tooltip-with-jquery-only-text/



这也是一个很好的例子,你可以实现鼠标以类似的方式出现!



http://api.jquery.com/ mouseover /



检查此示例,

http://jsfiddle.net/DLQsX/

I have an input field in a html and a help icon (?) next to the field, When I hover over the icon I want a simple text message to be displayed and the text message should disappear on hovering away. Any way to do this using jquery?

Icon will be a simple image say a small question mark. The text will be "Enter your name in the box"

解决方案

You can use "tooltip" to travel the text with the mouse while it is on the icon,

Here is a good example.

http://www.alessioatzeni.com/blog/simple-tooltip-with-jquery-only-text/

This is also a good example, you can implement mouse out in a similar way!

http://api.jquery.com/mouseover/

Check this example too,

http://jsfiddle.net/DLQsX/

这篇关于如何使用jQuery将鼠标悬停在图标上时显示简单的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆