Introduction
Before getting started here, please review the last article [Simple Style Switcher using jQuery and CSS-Part 2], so that you can understand the basics of the jQuery code used in this article.
Complete Page Code (You will find Event Bubbling Situation in this code):
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.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>
<title>Exploring jQuery</title>
<script src="Scripts/jquery-1.4.1.js"
type="text/javascript"></script>
<style type="text/css">
.hidden { display: none; }
.hover { cursor: pointer; background-color: Red; }
</style>
<script type="text/javascript">
//Mouse Hover
$(document).ready(function () {
$('#SwitchDIV b').hover(function () {
$(this).addClass('hover');
}, function () {
$(this).removeClass('hover');
});
});
//Hiding DIV
$(document).ready(function () {
$('#SwitchDIV').click(function () {
$('#SwitchDIV p').toggleClass('hidden');
});
});
</script>
</head>
<body>
<div id="SwitchDIV" style="background-color: Aqua;">
<b>Switchable DIV</b>
<p>
<button>Some Action</button>
<br />
Welcome to the Student's Section.
Please enter your Enrollment No. and Password
( type the Enrollment Number and Password as per the official records )
to access this section and to know the status of New admission/
Re-registration. In case of any difficulty in accessing the information,
contact us.
</p>
</div>
</body>
</html>



Amit MaheshwariPosted Mar 14, 2012, 12:10 PM
Hi, Abhimanyu it's a great effort to accomplish such task keep it up and thanks for sharing....