实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js">
5
</script>
6
<script>
7
$(document).ready(function(){
8
  var x=0;
9
  $("p").click(function(event){
10
    $("p").animate({fontSize:"+=5px"
11
  });
12
  x++;
13
  if (x>=2)
14
    {
15
    $(this).off(event);
16
    }
17
  });
18
});
19
</script>
20
</head>
21
<body>
22
23
<p>Click this p element to increase its size. The size can only be increased 2 times.</p>
24
25
</body>
26
</html>