Introduction
Creating attractive websites is desired by every web developers and this article will add one or more features to your existing web application.
Look at the sample screen that we will do in this article.

In the above screen you can see I've hovered my mouse on the second image.
Now follow the steps to create it.
Step 1:
Add the reference of jQuery file in head, for example:
<script type='text/javascript' src="Scripts/jquery-1.4.1.min.js"></script>
Step 2:
Now add jQuery method in the head section, for example:
<script type="text/javascript">
$(function () {
$('.myImage').each(function () {
$(this).hover(
function () {
$(this).stop().animate({ opacity: 1.0 }, 800);
},
function () {
$(this).stop().animate({ opacity: 0.3 }, 800);
})
});
});
</script>
Step 3:
Now add the style for images.
<style type="text/css">
.myImage
{
opacity:0.3;
filter:alpha(opacity=30);
}
</style>
Step 4:
Add the images on your web page, for example:
<p>
<asp:Image ID="Image1" runat="server" class="myImage"
ImageUrl="~/Images/abhi1.jpg" Height="220px" Width="195px"/>
<asp:Image ID="Image2" runat="server" class="myImage"
ImageUrl="~/Images/abhi2.jpg" Height="220px" Width="195px"/>
<asp:Image ID="Image3" runat="server" class="myImage"
ImageUrl="~/Images/abhi3.jpg" Height="220px" Width="195px"/>
<asp:Image ID="Image4" runat="server" class="myImage"
ImageUrl="~/Images/abhi4.jpg" Height="220px" Width="195px"/>
</p>

Chandra ShekharPosted Jul 18, 2012, 2:29 AM
How to enlarge image on mouseover in asp.net using jquery