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



Home Answers Viewqa JavaScriptQuestions Image swap on MouseOver ann Mouse out

Have Programming Question? Ask it here!
 
 
 


Aparna Acharya
Image swap on MouseOver ann Mouse out
0 Answer(s)      2 years and 4 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
The Mouse
Java NotesThe Mouse The mouse is handled automatically by most components... (and shouldn't care) whether this was from a mouse click on the button, or from..., in a JPanel) and need to know where the user clicks, then you need to know about mouse
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
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
how to use mouse pressed
how to use mouse pressed   to action mouse clicked
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
Mouse Listeners
the mouse listeners.   They are usually added to a graphics panel... implement the mouse listener interfaces in your non-panel class and write all.... For example, to listen for mouse clicks, p.addMouseListener(new
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
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
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
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
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
Mouse Buttons, Modifier Keys
Java NotesMouse Buttons, Modifier Keys Mouse Buttons. Java supports up to three mouse buttons. Even if your mouse doesn't have three separate... the mouse button. The MouseEvent object that is passed to the listener
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
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
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
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
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
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
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
Auto select cell on mouse hover using 'hover' mouse event
Auto select cell on mouse hover using 'hover' mouse event In this tutorial, we will discuss about how to highlight Table's cell on mouse hover using jQuery 'hover' mouse event. In this example, a table is given
log out
log out  how do i create a log out on a project without it exiting system so it does not reload again
Button with Image
toolbar...lets find out the steps. Steps of adding image on Button into iPhone...Button with iPhone Image In the given Iphone SDK tutorial, we are creating a button with iPhone image on it. There is nothing in adding Images of Iphone
Is there anyone out there?
Is there anyone out there?  Hi please could somebody respond as I am seeking advice but not getting any and do not know whether or not to continue using this site
Fading elements in and out example
Fading elements in and out example       Fading elements in and out example.... Example : Following code change the opacity of the image : $('
Program to draw rectangle on each mouse click and erase priviouse rectangles
Program to draw rectangle on each mouse click and erase priviouse rectangles  Program to draw rectangle on each mouse click and erase previous rectangle on next mouse click
Java Swing: Draw rectangle on mouse click
Java Swing: Draw rectangle on mouse click In this tutorial, you will learn how to draw a rectangle on mouse click. Sometimes, there is a need of mouse clicks in swing applications instead of buttons. To add this mouse interaction, Java
image scrolling
image in a folder when i scroll mouse or press right arrow key then next image...image scrolling  Hi My reqvirements are as below Input... should be diplayed on jframe Example : similar to image viewer
jQuery '.live' & '.die' Mouse events
jQuery '.live'  & '.die' Mouse events In this tutorial ,we will discuss about how to  remove an event using 'die' mouse event of jQuery. In this Example, we removes the 'click' event
Change Mouse sensitivity in Chart in Flex4
Change Mouse Sensitivity in Chart in Flex4: You can change the mouse... a slider for changing the value of mouse sensitivity. Example: <...;/fx:Script> <s:Panel title="Change mouse sensitivity
image retreival
image retreival  I ve stored the path of image and audio in mysql database. how to retrive it and display... Can u pls help me out
Java Swing code for zoom in and out
Java Swing code for zoom in and out  hi.......... I require a code in java swing for image zoom in and zoom out can u tell me how it can be done or what is the code plz help
How to create a JTable cell containing Image hyperlink?
How to create a JTable cell containing Image hyperlink?  I'm trying to find out how to create a JTable cell which contains Image, which should be clickable like an hyperlink. I'm able to load Image using default image renderer
JSP Out Object
JSP Out Object  JSP Out Object?   out object denotes... of the object out is jsp.JspWriter. The out object "Javax.servlet.jsp.JspWriter". Methods of out Object: clear() clearBuffer() flush() isAutoFlush() getBufferSize
with out class - Java Beginners
with out class  can we write a program with out a class in core java?if yes,give example
 

 

 

DMCA.com