Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

I am running through a problem and not able to solve it out plz help me out asap...

issue: I want to change multiple images on mouse over using java script and it should not work automatically unless on mouse is over...there may be 15 - 20 images. and also the image change should be fast....

[EDIT - moved from comment]
XML
<script language="JavaScript">
<!-- // preload images
if (document.images) {
img_on =new Image(); img_on.src ="../images/1.gif";
img_off=new Image(); img_off.src="../images/2.gif";
}
function handleOver(){
if (document.images) document.imgName.src=img_on.src;
}
function handleOut() {
if (document.images) document.imgName.src=img_off.src;
}
//--> </script>

[/EDIT]
Posted
Updated 3-Mar-13 16:16pm
v3
Comments
Sandeep Mewara 3-Mar-13 4:12am    
And the issue is? What have you tried? Where are you stuck?
[no name] 3-Mar-13 7:58am    
<pre lang="xml"><script language="JavaScript">
<!--
// preload images
if (document.images) {
img_on =new Image(); img_on.src ="../images/1.gif";
img_off=new Image(); img_off.src="../images/2.gif";
}
function handleOver() {
if (document.images) document.imgName.src=img_on.src;
}
function handleOut() {
if (document.images) document.imgName.src=img_off.src;
}
//-->
</script></pre>

this is only working between 2 images but i want it for 10 images so plz now help me out ...
Maciej Los 3-Mar-13 8:23am    
Next time use "Improve question" widget, OK?
[no name] 3-Mar-13 8:44am    
i don't want your suggestion or comment any way ......if you can solve the problem then only you are welcome to comment with the solved issue ... send me the code if you know....
Maciej Los 3-Mar-13 9:21am    
Dear Aasheesh Banerjee, i'm trying to help you understand the rules obligatory on CP forum. You don't need to listen to me and to do any thing, but out of kindness, i suggest you to adhere to rules.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900