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.

 

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.