<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.js" type="text/javascript"></script>
<script src="Scripts/main.js" type="text/javascript"></script>
Step 7: In this step you will see the body code of the Default2.aspx page which is given below.
Code
<body>
<h2>Image gallery with caption Using jQuery</h2>
<ul>
<li><a href="images/car.JPG" class="preview" title="Mercedes"><img src="images/car.JPG" height="78" width="104" alt="" /></a></li>
<li><a href="images/YellowTulips.jpg" class="preview" title="Yellow Tulips"><img src="images/YellowTulips.jpg" height="78" width="104" alt="" /></a></li>
<li><a href="images/wawk.jpg" class="preview" title="The Beauty of nature"><img src="images/wawk.jpg" height="78" width="104" alt="" /></a></li>
<li><a href="images/tajmahal.jpg" class="preview" title="Taj Mahalk- The Beauty of India"><img src="images/tajmahal.jpg" height="78" width="104" alt="" /></a></li>
</ul>
</body>
Step 8: In this step we will see the complete code of the Default2.aspx page which is given below.
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Image Preview with jQuery</title>
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.js" type="text/javascript"></script>
<script src="Scripts/main.js" type="text/javascript"></script>
<style type="text/css">
body
{
margin: 0;
padding: 40px;
background: #fff;
color: #555;
line-height: 180%;
font-family: Arial, Sans-Serif;
font-size: 0.75em;
}
h1
{
font-size: 180%;
font-weight: normal;
color: #555;
}
h2
{
clear: both;
font-size: 160%;
font-weight: normal;
color: #555;
margin: 0;
padding: .5em 0;
}
a
{
text-decoration: none;
color: #f30;
}
p
{
clear: both;
margin: 0;
padding: .5em 0;
}
pre
{
display: block;
font: 100% "Courier New" , Courier, monospace;
padding: 10px;
border: 1px solid #bae2f0;
background: #e3f4f9;
margin: .5em 0;
overflow: auto;
width: 800px;
}
img
{
border: none;
}
ul, li
{
margin: 0;
padding: 0;
}
li
{
list-style: none;
float: left;
display: inline;
margin-right: 10px;
}
#preview
{
position: absolute;
border: 1px solid #ccc;
background: #333;
padding: 5px;
display: none;
color: #fff;
}
</style>
</head>
<body>
<h2>Image gallery with caption Using jQuery</h2>
<ul>
<li><a href="images/car.JPG" class="preview" title="Mercedes"><img src="images/car.JPG" height="78" width="104" alt="" /></a></li>
<li><a href="images/YellowTulips.jpg" class="preview" title="Yellow Tulips"><img src="images/YellowTulips.jpg" height="78" width="104" alt="" /></a></li>
<li><a href="images/wawk.jpg" class="preview" title="The Beauty of nature"><img src="images/wawk.jpg" height="78" width="104" alt="" /></a></li>
<li><a href="images/tajmahal.jpg" class="preview" title="Taj Mahalk- The Beauty of India"><img src="images/tajmahal.jpg" height="78" width="104" alt="" /></a></li>
</ul>
</body>
</html>
Step 9: In this step we will see the design of the Default2.aspx page which is given below.
Step 10: In this step we are going to run the Default2.aspx page by pressing F5.
Now MouseHover on the image to see the effect.