|
|
Q1687 How do you make a generic function to change the image at on mouse out and on mouse over events which can be accessed from anywhere in the document just by specifiying the names of the images to change?
irt.org | Knowledge Base | JavaScript | Image | Q1687 [ previous next ] Q1687 How do you make a generic function to change the image at on mouse out and on mouse over events which can be accessed from anywhere in the document just by specifiying the names of the images to change?Here I have written the names of the images in the function along with at what index of the images[] array the SRC lies. On recieving the index value and the name of the image, it puts the index in the images[] array which changes the image now stored in the variable img_name. In this way I can call this function as many times and this single function will act for all the images in the document.
Submitted by anshumanmishra@yahoo.com |
-- div -->
|