如何显示图像名称 [英] How to show image name

查看:135
本文介绍了如何显示图像名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我上传图片并希望鼠标悬停或通过任何其他方法显示图片名称。

请帮助我。

Hi,

I m uploading image and want to show the image name on mouse over or by any other method.
Please help me.

推荐答案

您可以使用图片标签的Title属性,如下所示:

You can use Title property of image tag, like this :
<img src="smiley.gif" width="48" height="48" title="Smiley" />



当用户成功上传图片时动态填写此属性。

这是值得深思的;)


Fill this property dynamically when image is successfully uploaded by the user.
This is food for thought ;)


这不会由只是一个服务器端代码。你也需要一种客户端语言。



让我们以jQuery为例。您可以使用以下代码显示图像的名称:



Well this won't be done by just a Server-Side code. You'll need a client side language too.

Lets take the example of jQuery. You can show the image's name using this code:


img')。hover( function (){
alert(
('img').hover(function () { alert(


这篇关于如何显示图像名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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