<%@ Page Language=
"C#"
AutoEventWireup=
"true"
CodeFile=
"Default.aspx.cs"
Inherits=
"_Default"
%>
<!DOCTYPE html>
<head>
<title></title>
<style type=
"text/css"
>
body
{
font-family: Arial;
font-size: 16px;
}
.fontbtn
{
width: 40px;
height: 40px;
color: #fff;
text-align: center;
line-height: 40px;
font-size: 25px;
padding: 5px;
cursor: pointer;
}
.plus
{
background-color: green;
}
.minus
{
background-color: red;
}
</style>
</head>
<body>
<a
class
=
"fontbtn plus"
>A+</a> <a
class
=
"fontbtn minus"
>A-</a>
<hr />
<div id=
"contentdiv"
>
ASP.NET
is
an open source server-side Web application framework designed
for
Web
development to produce
dynamic
Web pages. It was developed by Microsoft to allow
programmers to build
dynamic
web sites, web applications and web services.
</div>
<script type=
"text/javascript"
>
$(
function
() {
$(
".fontbtn"
).bind(
"click"
,
function
() {
var
size =
parseInt
($(
'#contentdiv'
).css(
"font-size"
));
if
($(
this
).hasClass(
"plus"
)) {
size = size +
1
;
}
else
{
size = size -
1
;
if
(size <=
10
) {
size =
10
;
}
}
$(
'#contentdiv'
).css(
"font-size"
, size);
});
});
</script>
</body>
</html>