4/23/2016

Create A HTML Page With Rollover With A Mouse Events

Create A HTML Page With Rollover With A Mouse Events When We Enter The Mouse In Image .Image Should Be Change To Another Image And When We Mouse Out From Image Previous Image Should Be Display 

 Code Start Here

Hover.html

<html>
   
   <head>
      <title>Rollover with a Mouse Events</title>
      
      <script type="text/javascript">
         
            if(document.images){
               var image1 = new Image(); // Preload an image
               image1.src = "turndown.gif";
               var image2 = new Image(); // Preload second image
               image2.src = "nit.gif";
            }
      </script>
      
   </head>
   
   <body>
      <p>Move your mouse over the image to see the result</p>
      
      <a href="#" onMouseOver="document.myImage.src=image2.src;" onMouseOut="document.myImage.src=image1.src;">
      <img name="myImage" src="nit.gif" />
      </a>
   </body>
</html>

Output:-

Before Enter A Mouse In Image

www.programmingwithbasics.com

After Enter Mouse In Image 


www.programmingwithbasics.com

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

0 Comments: