change image in shopping website using javascript in asp.net

In previous javascript tutorials we have learned how to call javascript code from code behind, alert box in asp.net, confirm box in asp.net.

In this asp.net javascript post we will learn how to change or how to display big image while mouse over on small images. Generally we have seen this kind of functionality in online shopping website. In online shopping website when user buy something that viewmore page user can see the product description with display images, we can see the product big image one by one while mouse over of the small image.

 change image while onmousover in asp.net

change image while onmousover in asp.net

For do this asp.net example we have use javascript onmouseover event to change the image respectively.

First Create web application in visual studio 2010 with one web form.

In this asp.net example we have taken three small image control and one for display big image control in asp.net web page. and write javascript function to change image while on mouse  over on small images. here we call this javascript function in onmouseover events of three small image control.

Note : create new folder “img” and paste three images in this folder.

Here is the html design code :

After design web for write below javascript code in head tag of html page.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

1 + 1 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">