(转)关于文字放大缩小
内容转自 https://blog.csdn.net/iteye_3606/article/details/82297499
注意 jquery 引入
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<script src="jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<p>A就变大</p>
<button type="button" id="Anim" onclick="cti()">1111</button>
</body>
<script type="text/javascript">
function cti() {
console.log("1111")
$('p').animate({
fontSize: '+=7px'
}); //animate() 实现改变css样式的方法
$('p').animate({
fontSize: '-=7px'
},200);
}
</script>
</html>
<!DOCTYPE html >
<html >
<head runat="server">
<title></title>
<script src="Jquery1.7.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
// $('p').one('click', function () {
// $(this).animate({ fontSize: '+=7px' });
// }) //只能点击一次
$('p').bind('click', function () {
$(this).animate({ fontSize: '+=7px' }); //animate() 实现改变css样式的方法
})//可以连续放大
})
</script>
</head>
<body>
<form id="form1">
<p>打小代,我就变大</p>
</form>
</body>
</html>

浙公网安备 33010602011771号