Jquery教学基础,简单的淡入淡出,隐藏显示,改变CSS等

一定要引入Jquery文件,不废话,直接上代码,复制粘贴就可以跑,在script括起来,已经注释了,自己一条一条看效果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
+Tenus One <!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags must come first in the head; any other head content must come after these tags -->
    <title>Bootstrap 101 Template</title>
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <style type="text/css">
 
  .jumbotron {text-align: center;}
  </style>
 
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
 
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
<div class="container">
  <div class="jumbotron">
    <h1>Let's have Fun</h1>     
    <button type="button" id="btn1" class="btn btn-default">#btn1</button>
    <button type="button" id="btn1" class="btn btn-default">#btn2</button>
    <button type="button" id="btn1" class="btn btn-default">#btn3</button>
    <button type="button" id="btn1" class="btn btn-default">#btn4</button>
  </div>
  <div class="col-xs-3">
  <div id="panel1" class="panel panel-primary">
  <div class="panel-heading">
   #panel1
  </div>
  <div class="panel-body"> Contet
  </div>
 
  </div>
  </div>
  <div class="col-xs-3">
  <div id="panel2" class="panel panel-primary">
  <div class="panel-heading">
   #panel2
  </div>
  <div class="panel-body"> Contet
  </div>
 
  </div>
  </div>
  <div class="col-xs-3">
  <div id="panel3" class="panel panel-primary">
  <div class="panel-heading">
   #panel3
  </div>
  <div class="panel-body"> Contet
  </div>
 
  </div>
  </div>
  <div class="col-xs-3">
  <div id="panel4" class="panel panel-primary">
  <div class="panel-heading">
   #panel4
  </div>
  <div class="panel-body"> Contet
  </div>
 
  </div>
  </div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <!-- <script src="js/bootstrap.min.js"> -->
<script type="text/javascript">
    // $(document).ready(function(){
    //   $("#panel1").hide(300);
    // });
     
    // 一条一条尝试,把后面字体注释
    // $("#panel1").hide(300).show(1000); 隐藏花0.3秒后显示花1秒
    // $("#panel1").hide(300).show(100).hide(300).show(100);
    // $("#panel1").slideUp(1000).delay(1000).slideDown(1000);    1秒时间向上,延迟一秒,然后再1秒时间向下
    // $("#panel1").fadeOut(1000).delay(1000).slideDown(1000);
    // $("#panel1").fadeToggle(1000).fadeToggle(1000); 淡出淡入
    // $("#panel1").slideToggle(1000).slideToggle(1000);
    // $("#panel1").toggle(1000).toggle(1000);
     // $("#panel1").css({
        //  color:'red',
        //  fontWeight:'bold',
        //  });
          // 给css添加颜色字体等等
           
      
     
     
</script>
     
 
   
  </body>
</html>

  

posted @   漫漫长路</>  阅读(57)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 25岁的心里话
· 按钮权限的设计及实现
点击右上角即可分享
微信分享提示