first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>event</title>
</head>
<body>
<!-- <p onclick="demos()">111</p> -->
<p>2222</p>
</body>
<script>
// function demos () {
// alert("111")
// }
var p = document.querySelector("p");
p.onclick = function (e) {
// console.log(e.target);
// console.log(e.target.innerText);
console.log(p.innerText);
}
// document.querySelector("p").addEventListener('click', function() {
// console.log("1");
// })
</script>
</html>

View File

@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>js方法</title>
</head>
<body>
</body>
<script>
// 定义方法
// 无参方法
// function 作用: 主要用来实现相同代码的封装和代码的复用
function fff() {
return "我是方法"
}
// 用户的个人中心
// function fff () {
// this.name = "zhangab"
// // console.log(arguments[0]);
// // return "饭店收到:"+a
// this.test = function () {
// console.log("test function");
// }
// }
// console.log(new fff().name);
// var a = fff('10元','20元','30元')
// console.log(a);
// 方法内部定义的变量 局部作用域,
// 变量提升 变成全局变量
// function demo() {
// var a = 1;
// console.log("第一次打印", a); // 1
// }
// demo()
// console.log("第二次打印", a); // 1
// 自执行函数 用于框架封装代码
// 匿名函数
// (function () {
// console.log(111);
// })()
// 回调
var a = function (item) {
// a 自身的逻辑
item("qiuan")
}
// 回调有什么作用!!???????
// 回调地狱
a(function (res) {
//1
a(function (res) {
//2
a(function (res) {
//3
a(function (res) {
//4
a(function (res) {
//5
a(function (res) {
// 找工作
})
})
})
})
})
});
// var f = function() {
// }
// var r = f
// r()
</script>
</html>

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tabs</title>
</head>
<body>
<div class="zhanga">
</div>
</body>
<script>
var TabsTitle = document.querySelectorAll(".tabs_title li");
var TabsContent = document.querySelectorAll(".tabs_content li");
TabsTitle.forEach((val,index) => {
val.onclick = () => {
TabsTitle.forEach( (v,i) => {
v.className = ""
TabsContent[i].className = ""
})
val.className = "tabs_title_active"
TabsContent[index].className = "tabs_content_active"
}
})
</script>
</html>

View File

@@ -0,0 +1,57 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body,ul,li{
margin: 0;
padding: 0;
list-style: none;
}
.tabs_top{
overflow: hidden;
}
.tabs_top li{
float: left;
}
.tabs_style{
color: red;
}
.tabs_color{
display: block !important;
}
.tabs_bottom li{
display: none
}
</style>
<body>
<ul class="tabs_top">
<li class="tabs_style">公告</li>
<li>规则</li>
<li>通知</li>
</ul>
<ul class="tabs_bottom">
<li class="tabs_color">公告的内容</li>
<li>规则的内容</li>
<li>通知的内容</li>
</ul>
</body>
<script>
var Tabstitle = document.querySelectorAll(".tabs_top li")
var Tabscontent = document.querySelectorAll(".tabs_bottom li")
Tabstitle.forEach((val,index)=>{
val.onclick=()=>{
Tabstitle.forEach((v,i)=>{
v.className=""
Tabscontent[i].className=""
})
val.className="tabs_style"
Tabscontent[index].className="tabs_color"
}
})
</script>
</html>