Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JavaScriptQuestions Image swap on MouseOver ann Mouse out
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Aparna Acharya
Image swap on MouseOver ann Mouse out
0 Answer(s)      2 years and 8 months ago
Posted in : JavaScript Questions


I tried ur code for multiple images but didnt get the right answer...i dont want the hardcodded code...a code which is flexible with multiple images

<html>
<script language="javascript" type="text/javascript">
if(document.images) {
arr = new Array();
arr[1] = new Image();
arr[1].src = "1.jpg";
arr[2] = new Image();
arr[2].src = "2.png";
}
function swapImages(imagename, pic) {
document.images[imagename].src = arr[pic].src;
}
</script>
<a onMouseOver="swapImages('img1',1)" onMouseOut="swapImages('img1',2)" href="javascript:void">
<img name="img1"  src="1.jpg"  width="250">
</a>
</script>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
Image swap on MouseOver ann Mouse out
Image swap on MouseOver ann Mouse out  I tried ur code for multiple images but didnt get the right answer...i dont want the hardcodded code...a code...(); arr[1] = new Image(); arr[1].src = "1.jpg"; arr[2] = new Image(); arr[2].src
Image swap on mouse over and mouse move
Image swap on mouse over and mouse move  i tried the code , sent form u...But if there are 50 images and..i want swap images on mousse over and mouse out, then the code becomes very lengthy...so please give the code for multiple
Advertisements
Image swap on mouse over and mouse move
Image swap on mouse over and mouse move  i tried the code , sent form u...But if there are 50 images and..i want swap images on mousse over and mouse out, then the code becomes very lengthy...so please give the code for multiple
Swap images oon mouse over and mouse out
Swap images oon mouse over and mouse out  I have multiple images...i want to swap each image on mouse out and mouse over..   <html>...) { arr = new Array(); arr[1] = new Image(); arr[1].src = "rose1.jpg"; arr[2] = new
Mouseover Image Dispaly
Mouseover Image Dispaly  Hi, I need HTML code for mouseover image display, when the mouse is on some text. Thanks in advance.   for this you have to use java script code by making a function
mouseover
mouseover  Sir, I have stored three images in database for one perticular item,when search is made only one image is dispaled,i want to do mouseover on that image and display other two images in popup using javascript or ajax
mouseover effect
mouseover effect  Sir, I have stored three images in database for one perticular item,when search is made only one image is dispaled,i want to do mouseover on that image and display other two images in popup. please help Thanks
'append' & 'fade out/in' on mouse hover
'append' & 'fade out/in' on mouse hover In this tutorial, we will discuss about how to apply 'append' & 'fade out/in'...; is appended on it & it will fade out/in to show mouse pointing. The fadeout is set
JAVA image zoom in/out - Framework
JAVA image zoom in/out  how to write function in java for image zoom in and zoom out using jFreeChart?  Hi Friend, Try the following... static void main(String [] args) { Chart demo = new Chart("Mouse Zoom
mouse events
mouse events  When i click a button i want to retrieve image and audio from database and play it. how can i do dis. I m using Netbeans IDE and mysql for database. pls do hel[p me
Mouse Listener
Mouse Listener  how to move any object with help of mouse but not drag it in an applet
Program to swap the string
Program to swap the string  Hi, can any one tell me the code to swap the 2 strings without using temporary varibales??? Thanks a lot in advance!!   Here is an example that prompts the user to enter two string
Mouse Motion
Mouse Motion  Could you please send me the code of finding the (x,y) co-ordinates in a JFrame Compoenent..?? I need it urgently for my project
how to use mouse pressed
how to use mouse pressed   to action mouse clicked
Move Image in Java Swing
How to Move Image in Java Swing In this section, you will learn how to move an image using mouse. For this purpose, we have specified an image and using the MediaTracker class, the image is tracked by the method addImage(). The Graphics
mouse over effects in css
mouse over effects in css  I have written a mouse over effect in CSS. But it is not working in HTML. Can any one suggest me? Thanks
How to design a mouse
How to design a mouse Follow this example to learn how to design a mouse. New File: First take a new file (Ctrl + N). Use Pen Tool (P... mouse pointer then select Direct selection tool (A key) and adjust the points
how to highlight the field in image,when i have entered into that corresponding field's textbox-any one help out
how to highlight the field in image,when i have entered into that corresponding field's textbox-any one help out  how to highlight the field in image... consist of a jpeg image on the top and below that image fields(text boxes) exist
How To Move Image Smoothly
;  In this example you will see how to move image smoothly on mouse... where the MouseMotionListener interface is called to move an image on mouse... when a mouse button is pressed on the image. Then the image will dragged
mouse event - Java Beginners
mouse event  import javax.swing.*; import java.awr.*; import...=getContentPane(); setLayout(new FlowLayout()); setTitle("Mouse Event..."); public MouseEventt() { f.setLayout(new FlowLayout()); f.setTitle("Mouse
4D Mouse
4D Mouse       Here... mouse is an advanced species of traditional 2D mouse that can move only horizontal no vertical, while 4D mouse can move all the direction ups & down and left
Swap two xml nodes through java class - XML
Swap two xml nodes through java class   Could you please let me know How to swap the two xml nodes thorugh java class
Zoom Image section using jQuery plug-in
Zoom Image section using jQuery plug-in In this section, you will learn how to zoom an image section by hovering mouse on it using jQuery. The plug-in ,we are using here, is "zoom.js". For zooming an image you must have
JavaScript Zoom in and Zoom out
illustrates you how to zoom in and zoom out of an image using JavaScript. Here we... and width of the image and make it to show the effect Zoom In and Zoom Out... the image zoom in and zoom out. As long as you put the cursor on the link Zoom
Swap two numbers without using third variable
Swap two numbers without using third variable In this section we are going to swap two variables without using the third variable. For this, we have used input.nextInt() method of Scanner class for getting the integer type values
adding mouse listeners to drop target
adding mouse listeners to drop target  import java.awt.*; import... with adding mouse listeners to "table" which is drop target, to accept drop component wherever it drops from the mouse. in this code when component drops
Java Panel squres swap - Java Server Faces Questions
Java Panel squres swap  I have written a coputer game that has 8*8 squres and it has 7 different images stored in the array now placing them on the form i have done that the problem is to swap them veticaly and horizontaly
Handling Mouse Clicks in Java
Handling Mouse Clicks in Java     ... the mouse click event in the awt application. This program simply implements the left click event of the mouse. When you click "Click Me" button
image
image  how to add the image in servlet code
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
Advertisements
 

 

 

DMCA.com