实例代码“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
    x++;
12
    if (x>=2)
13
      {
14
      $(this).unbind(event);
15
      }
16
  });
17
});
18
</script>
19
</head>
20
<body>
21
22
<p style="font-size:20px;">Click this p element to increase its size. The size can only be increased 2 times.</p>
23
24
</body>
25
</html>
26
27