Jump to content

Recognizing the name of the pictures when onmouseover?


bilis_money

Recommended Posts

Hi

 

I want to know if how a javascript can recognize the name of a picture.

Let say i have two pictures.

 

Picture A. name is "bubble.jpg"

...then

Picture B. name is "duck.jpg"

 

When i hover the mouse using the onmouseover() function on one of the picture. The javascript should smart enough to recognize the name of the picture and display the name of that picture. Is this possible?

 

If so, please could you show me some sample codes for this please.

 

Thank you very much in advance.

 

 

Link to comment
Share on other sites

JS like any other programming language will do what you tell it. If you don't say what's the image src, the script can't find it. You can make a function and pass the image src to the function

 

<a href="#" onmouseover="do_something('bubble.jpg');">Some text</a>

 

This way your function will take the source image and do what it needs using that.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.