<script src="../../scripts/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("span").click(function () {
var thisEle = $("#para").css("font-size");
var textFontSize = parseInt(thisEle, 10);
var unit = thisEle.slice(-2);
var cName = $(this).attr("class")
if (cName == "bigger") {
textFontSize += 2;
} else if (cName == "smaller") {
textFontSize -= 2;
}
$("#para").css("font-size", textFontSize + unit);
});
});
</script>
</head>
<body>
<div class="msg">
<div class="msg_caption">
<span class="bigger">放大</span>
<span class="smaller">缩小</span>
</div>
<div>
<p id="para">
This is some text. This is some text. This is some text. This is some text. This
is some text. This is some text. This is some text. This is some text. This is some
text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This
is some text. This is some text.
</p>
</div>
</div>