├── .gitignore
├── 7-6放大镜
├── 拖拽.html
└── 放大镜
│ ├── img
│ ├── 11.png
│ └── big.png
│ ├── js
│ └── dome.js
│ ├── 放大镜.html
│ └── 放大镜.txt
├── README.md
├── 倒计时.html
├── 冒泡排序.html
├── 判断[]的匹配.js
├── 十六进制颜色值随机生成.html
├── 大乐透.html
├── 字符串查找-不使用原生方法.js
├── 折叠菜单.html
├── 拖拽.html
├── 排他思想.html
├── 改变指向.html
├── 数组最大最小.html
├── 水仙花数.html
├── 添加地址
├── css
│ └── style.css
├── js
│ └── demo.js
├── 地址添加.html
└── 添加地址.html
├── 漫天星星
├── img
│ └── xingxing.gif
└── 星星.html
├── 爱好
├── css
│ ├── img
│ │ ├── QQ图片20160219081343.png
│ │ ├── QQ图片20160219081401.png
│ │ ├── add.jpg
│ │ ├── bg.jpg
│ │ └── tip.jpg
│ └── style.css
└── index.html
├── 用户评论
├── css
│ └── style.css
├── img
│ └── userBj.png
├── js
│ └── demo.js
├── pinglun.html
├── 用户评论.html
└── 网友评论.html
├── 获取验证码.html
├── 轮播图
├── img
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ ├── 5.jpg
│ ├── 6.jpg
│ ├── l.png
│ └── r.png
└── index.html
├── 过路口问题.html
├── 递归.html
├── 闭包选项卡.html
├── 随机打乱一个数组.js
├── 随机抽奖.html
├── 隔行变色.html
└── 面向对象.html
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 |
--------------------------------------------------------------------------------
/7-6放大镜/拖拽.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/7-6放大镜/放大镜/img/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/7-6放大镜/放大镜/img/11.png
--------------------------------------------------------------------------------
/7-6放大镜/放大镜/img/big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/7-6放大镜/放大镜/img/big.png
--------------------------------------------------------------------------------
/7-6放大镜/放大镜/js/dome.js:
--------------------------------------------------------------------------------
1 | var small = document.querySelector(".small"),
2 | glass = document.querySelector(".glass"),
3 | big = document.querySelector(".big"),
4 | bg = document.querySelector(".bg"),
5 | pos = null,
6 | fd = null;
7 | small.onmouseover = function() {
8 | glass.style.display = "block";
9 | big.style.display = "block";
10 | //设置的放大镜变量只能在放大镜显示以后设置如果放大镜不显示的话设置以后是不能打印出来放大镜的宽高
11 | fd = {
12 | //获取放大镜的宽高
13 | w: glass.offsetWidth,
14 | h: glass.offsetHeight
15 | };
16 | //求出大盒子的宽与放大镜的宽的比值
17 | scal = big.offsetHeight / glass.offsetHeight
18 | console.log(scal)
19 | }
20 | small.onmouseout = function() {
21 | glass.style.display = "none";
22 | big.style.display = "none";
23 | }
24 | small.addEventListener("mousemove", function(e) {
25 | var eve = e || event;
26 | pos = {
27 | x: eve.pageX - small.offsetLeft - fd.w / 2,
28 | y: eve.pageY - small.offsetTop - fd.h / 2
29 | };
30 | if (pos.x < 0) {
31 | pos.x = 0;
32 | }
33 | if (pos.y < 0) {
34 | pos.y = 0;
35 | }
36 | if (pos.x > small.offsetWidth - fd.w) {
37 | pos.x = small.offsetWidth - fd.w;
38 | }
39 | if (pos.y > small.offsetHeight - fd.h) {
40 | pos.y = small.offsetHeight - fd.h;
41 | }
42 | glass.style.left = pos.x + "px";
43 | glass.style.top = pos.y + "px";
44 | bg.style.left = -pos.x * scal + "px"
45 | bg.style.top = -pos.y * scal + "px"
46 | console.log(pos)
47 | })
--------------------------------------------------------------------------------
/7-6放大镜/放大镜/放大镜.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
45 |
46 |
47 |
48 |

49 |
50 |
51 |
52 |

53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/7-6放大镜/放大镜/放大镜.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/7-6放大镜/放大镜/放大镜.txt
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # js_algorithm
2 | 一些经典的js算范
3 | #### 递归
4 | 使用递归对对象进行遍历,然后将对象渲染到html页面中,页面的结构与对象中的属性结构相同
5 |
--------------------------------------------------------------------------------
/倒计时.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 国庆回家倒计时:天小时分秒
11 |
31 |
32 |
--------------------------------------------------------------------------------
/冒泡排序.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
7 |
8 |
25 |
26 |
--------------------------------------------------------------------------------
/判断[]的匹配.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @param {Array} lefts 左括号的索引集合
4 | * @param {*} rights 右括号的索引集合
5 | */
6 | function exec(lefts, rights) {
7 | const all = lefts.concat(rights);
8 | const execRes = [];
9 | lefts.forEach(left => {
10 | let rightIndex = rights.findIndex(right => {
11 | let leftNum = findNumsAtSection(left, right, lefts);
12 | let rightNum = findNumsAtSection(left, right, rights);
13 | let result = findNumsAtSection(left, right, all)
14 | return isOdd(result) && (leftNum === rightNum);
15 | });
16 | let right = rights[rightIndex];
17 | rights.splice(rightIndex, 1);
18 | execRes.push({ left, right });
19 | });
20 | return execRes;
21 | }
22 |
23 | function findNumsAtSection(start, end, arr) {
24 | let all = 0;
25 | arr.forEach(item => {
26 | if (item < end && item > start) {
27 | all++;
28 | }
29 | });
30 | return all;
31 | }
32 | function isOdd(num) {
33 | return num % 2 === 0;
34 | }
35 |
36 | // const str = '[[],[],[]][]'
37 | const str = '[o[j]][]w[[]]fo'
38 | console.log(exec([0, 2, 6, 9, 10], [4, 5, 7, 11, 12]));
39 | // console.log(exec([0,1,4,7,10], [2,5,8,9,11]));
40 |
--------------------------------------------------------------------------------
/十六进制颜色值随机生成.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 十六进制颜色值随机生成
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
41 |
42 |
--------------------------------------------------------------------------------
/大乐透.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
119 |
120 |
--------------------------------------------------------------------------------
/字符串查找-不使用原生方法.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @param {string} firstLetter 子传中的第一个字符
4 | * @param {string} parentStr 父串
5 | * @returns {Array} 在父串中匹配子串第一个字符的索引集合。
6 | */
7 | function collectLetterIndex(firstLetter,parentStr){
8 | const firstLetterIndexs = []
9 | for(let i = 0; i < parentStr.length; i++){
10 | if(firstLetter === parentStr[i]){
11 | firstLetterIndexs.push(i);
12 | }
13 | }
14 | return firstLetterIndexs;
15 | }
16 | /**
17 | *
18 | * @param {*} collectIndex
19 | * @param {*} parentStr
20 | * @param {*} childStr
21 | */
22 | function findFromCollectIndex(collectIndex,parentStr,childStr){
23 | for(let i = 1; i < childStr.length; i++){
24 | if(collectIndex + 1 >= parentStr.length){
25 | return false;
26 | }
27 | // console.log(parentStr[collectIndex + i], childStr[i]);
28 | if(parentStr[collectIndex + i] !== childStr[i]){
29 | return false;
30 | }
31 | }
32 | return true;
33 | }
34 | function findStr(childStr, parentStr){
35 | const firstLetterIndexs = collectLetterIndex(childStr[0],parentStr);
36 | // console.log(firstLetterIndexs);
37 | for(let i = 0; i < firstLetterIndexs.length; i++){
38 | const result = findFromCollectIndex(firstLetterIndexs[i],parentStr,childStr);
39 | if(result){
40 | return firstLetterIndexs[i];
41 | }
42 | }
43 | return false;
44 | }
45 |
46 | const a = '56'
47 | const b = '15656';
48 | console.log(findStr(a,b));
49 |
--------------------------------------------------------------------------------
/折叠菜单.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
18 |
19 |
20 |
21 |
22 |
23 |
权限管理
24 |
63 |
已选中:
64 |
65 |
66 |
67 |
206 |
207 |
208 |
--------------------------------------------------------------------------------
/拖拽.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
10 |
11 |
12 |
13 |
55 |
56 |
--------------------------------------------------------------------------------
/排他思想.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
7 |
8 |
9 | - 1
10 | - 2
11 | - 3
12 | - 4
13 | - 5
14 |
15 |
27 |
28 |
--------------------------------------------------------------------------------
/改变指向.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/数组最大最小.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/水仙花数.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 算法3
6 |
7 |
8 |
28 |
29 |
--------------------------------------------------------------------------------
/添加地址/css/style.css:
--------------------------------------------------------------------------------
1 |
2 | *{
3 | margin: 0;
4 | padding: 0;
5 | }
6 | body{
7 | width: 100%;
8 | height: 100%;
9 | }
10 | .mark{
11 | width: 100%;
12 | height: 100%;
13 | background: rgba(0,0,0,.5);
14 | position: fixed;
15 | top: 0;
16 | left: 0;
17 | }
18 | .hide{
19 | display: none;
20 | }
21 | .content{
22 | position: relative;
23 | left: 35%;
24 | top: 30%;
25 | width: 400px;
26 | height: 300px;
27 | background: skyblue;
28 | }
--------------------------------------------------------------------------------
/添加地址/js/demo.js:
--------------------------------------------------------------------------------
1 | window.onload = function() {
2 | //获取添加地址按钮
3 | var btn = document.getElementById("btn");
4 | //获取遮罩层
5 | var mark = document.getElementById("mark");
6 | //获取第一个文本框(地址框)
7 | var addres = document.getElementById("addres");
8 | //获取第二个文本框(门牌号)
9 | var number = document.getElementById("number");
10 | //获取用来存储地址的ul
11 | var ulId = document.getElementById("ulId");
12 | //获取添加按钮
13 | var add = document.getElementById("add");
14 | //获取取消按钮
15 | var res = document.getElementById("res");
16 |
17 | btn.onclick = function() {
18 | //清除hide类 显示蒙层
19 | mark.classList.remove("hide");
20 |
21 | //给添加按钮绑定事件
22 | add.onclick = function() {
23 | //创建li节点
24 | var oLi = document.createElement("li");
25 | //将两个文本框中的value写入到新建的li中
26 | oLi.innerHTML = `地址:${addres.value} 门牌号:${number.value}`;
27 | ulId.appendChild(oLi); //将新建li追加到ul中
28 | mark.classList.add("hide"); //隐藏蒙层
29 | //清除文本框中的内容
30 | addres.value = "";
31 | number.value = "";
32 | //重新绑定删除
33 | remove();
34 |
35 |
36 | }
37 | res.onclick = function() {
38 | mark.classList.add("hide");
39 | //清除文本框中的内容
40 | addres.value = "";
41 | number.value = "";
42 | }
43 |
44 |
45 | }
46 |
47 | function remove() {
48 | for (var i = 0; i < ulId.children.length; i++) {
49 | ulId.children[i].onclick = function() {
50 | ulId.removeChild(this);
51 | }
52 | }
53 |
54 | }
55 | remove();
56 |
57 |
58 |
59 | }
--------------------------------------------------------------------------------
/添加地址/地址添加.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
29 |
30 |
31 |
32 |
33 |
34 | - 北京市大兴区榆垡八维默认地址
35 | - 北京市中关村科技园默认地址
36 | - 北京市朝阳区朝阳人民群众委员会默认地址
37 |
38 |
39 |
47 |
78 |
79 |
--------------------------------------------------------------------------------
/添加地址/添加地址.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
29 |
30 |
31 |
32 |
33 |
34 | - 北京市大兴区榆垡八维默认地址
35 | - 北京市中关村科技园默认地址
36 | - 北京市朝阳区朝阳人民群众委员会默认地址
37 |
38 |
39 |
47 |
84 |
85 |
--------------------------------------------------------------------------------
/漫天星星/img/xingxing.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/漫天星星/img/xingxing.gif
--------------------------------------------------------------------------------
/漫天星星/星星.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
7 |
8 |
9 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/爱好/css/img/QQ图片20160219081343.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/爱好/css/img/QQ图片20160219081343.png
--------------------------------------------------------------------------------
/爱好/css/img/QQ图片20160219081401.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/爱好/css/img/QQ图片20160219081401.png
--------------------------------------------------------------------------------
/爱好/css/img/add.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/爱好/css/img/add.jpg
--------------------------------------------------------------------------------
/爱好/css/img/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/爱好/css/img/bg.jpg
--------------------------------------------------------------------------------
/爱好/css/img/tip.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/爱好/css/img/tip.jpg
--------------------------------------------------------------------------------
/爱好/css/style.css:
--------------------------------------------------------------------------------
1 | *{
2 | margin:0;
3 | padding:0;
4 | }
5 |
6 | ul{
7 | list-style:none;
8 | }
9 |
10 | .container{
11 | width:550px;
12 | height:160px;
13 | margin:50px auto;
14 | padding:10px;
15 | }
16 |
17 | .options{
18 | width:450px;
19 | }
20 |
21 | .options li,.result li{
22 | width:100px;
23 | height:27px;
24 | float:left;
25 | margin:0 10px 15px 0;
26 | background-image:url(img/bg.jpg);
27 | background-repeat:no-repeat;
28 | color:#A2A3A8;
29 | font-size:14px;
30 | line-height:27px;
31 | text-align:center;
32 | cursor:pointer;
33 | }
34 |
35 | .options .select{
36 | background-position:0 -27px;
37 | color:#F9b550;
38 | }
39 |
40 | .button-info{
41 | clear:both;
42 | width:550px;
43 | height:31px;
44 | margin-bottom:15px;
45 | }
46 |
47 | .button{
48 | clear:both;
49 | width:234px;
50 | height:31px;
51 | background:url(img/add.jpg) no-repeat;
52 | float:left;
53 | }
54 |
55 | .button p{
56 | width:154px;
57 | margin:6px 0 0 12px;
58 | float:left;
59 | }
60 |
61 | .button p input{
62 | width:145px;
63 | border:none;
64 | outline:none;
65 | }
66 |
67 | .button span{
68 | display:block;
69 | float:left;
70 | width:65px;
71 | height:25px;
72 | cursor:pointer;
73 | margin-top:4px;
74 | text-align:center;
75 | color:#fff;
76 | font-size:13px;
77 | line-height:25px;
78 | }
79 |
80 | .tip{
81 | width:265px;
82 | height:21px;
83 | float:left;
84 | margin-left:15px;
85 | background:url(img/tip.jpg) no-repeat left bottom;
86 | padding:10px 0 0 16px;
87 | font-size:12px;
88 | display:none;
89 | }
90 |
91 | .result li{
92 | background-position:left bottom;
93 | cursor:default;
94 | position:relative;
95 | }
96 |
97 | .result li span{
98 | position:absolute;
99 | width:15px;
100 | height:15px;
101 | top:0;
102 | right:0;
103 | cursor:pointer;
104 | background:transparent;
105 | }
106 |
107 |
--------------------------------------------------------------------------------
/爱好/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
7 |
8 |
9 |
10 |
11 |
12 | - 音乐
13 | - 美术
14 | - 体育
15 | - 游戏
16 | - 旅游
17 | - 跑步
18 | - 爬山
19 | - 探险
20 |
21 |
22 |
31 |
36 |
37 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/用户评论/css/style.css:
--------------------------------------------------------------------------------
1 | *{margin: 0;padding:0; }
2 | li{list-style: none;}
3 | body{background: #f9f9f9;font-size: 14px;}
4 | #box{width: 620px;padding:10px;border:1px solid #ccc;background:#f4f4f4;margin: 10px auto; }
5 | #fill_in{margin-bottom: 10px;}
6 | #fill_in li{padding: 5px 0;}
7 | #fill_in .text{width: 480px;height: 30px;padding: 0 10px;border:1px solid #ccc;line-height:30px;font-size:14px;font-family: arial;margin-left: 14px;}
8 | #fill_in textarea{width: 480px;height: 100px;line-height: 20px;padding: 5px 10px;border:1px solid #ccc;font-size:14px;font-family:arial;overflow: auto;vertical-align:top;}
9 | #fill_in .btn{width: 100px;height: 30px;border: 1px solid #ccc;background: #fff;color: #666;font-size: 14px;position: relative;left: 65px;cursor: pointer;}
10 | #message_text{display:none;}
11 | #message_text h2{font-size:14px;padding:6px 0 4px 10px;background: #ddd;border-bottom: 1px solid #ccc;position: relative;}
12 | #message_text li{background: #f9f9f9;border-bottom: 1px solid #ccc;color:#666;overflow: hidden;position: relative;}
13 | #message_text img{position: absolute;left: 0px;padding: 10px;}
14 | #message_text h3{padding: 6px;font-size: 14px;line-height: 24px;width: 100px;margin-left: 20px;}
15 | #message_text h5{padding: 4px;font-size: 12px;line-height: 24px;position: absolute;right: 8px;top: 2px;}
16 | #message_text p{padding: 0 10px 10px;text-indent: 40px;line-height: 20px;}
17 | #btn1{border: none;cursor: pointer;color: #666;}
18 | #pid{position: absolute;right: 10px;top: 5px;font-size: 12px;color: #666;}
19 | #aid{color: blue;}
--------------------------------------------------------------------------------
/用户评论/img/userBj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/用户评论/img/userBj.png
--------------------------------------------------------------------------------
/用户评论/js/demo.js:
--------------------------------------------------------------------------------
1 | ;window.onload = function(){
2 | function $(idName){
3 | return document.querySelector(idName);
4 | }
5 | // 1) 获取节点
6 | var user = $("#text"),
7 | content = $("#content"),
8 | btn = $("#btn"),
9 | hideBtn = $("#btn1"),
10 | count = $("#aid"),
11 | mText = $("#message_text"),
12 | ulId = $("#ulId");
13 | // 2) 点击提交按钮
14 | btn.onclick = function(){
15 | if( user.value == "" || content.value == "" ){
16 | alert( "您还没有输入用户名或评论内容" );
17 | }else{
18 | // 1> 创建节点
19 | var oLi = document.createElement("li");
20 | // 2> 设置节点
21 | oLi.innerHTML = `
22 | ${user.value}
23 | ${new Date().toLocaleString()}
24 | ${content.value}
`;
25 | // 3> 追加节点
26 | ulId.insertBefore( oLi , ulId.firstChild );
27 | mText.style.display = "block";// 显示评论的盒子
28 | count.innerHTML = +count.innerHTML + 1;// 评论个数计数
29 | user.value = "";
30 | content.value = "";
31 | }
32 | }
33 |
34 | // 3) 点击显示隐藏按钮
35 | hideBtn.onclick = function(){
36 | if(this.innerHTML == "隐藏留言"){
37 | ulId.style.display = "none";// 隐藏评论的盒子
38 | this.innerHTML = "显示留言";
39 | }else{
40 | ulId.style.display = "block";// 显示评论的盒子
41 | this.innerHTML = "隐藏留言";
42 | }
43 | }
44 | };
--------------------------------------------------------------------------------
/用户评论/pinglun.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
34 |
76 |
77 |
--------------------------------------------------------------------------------
/用户评论/用户评论.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 用户评论
6 |
7 |
8 |
9 |
10 |
34 |
35 |
--------------------------------------------------------------------------------
/用户评论/网友评论.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
34 |
69 |
70 |
--------------------------------------------------------------------------------
/获取验证码.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
28 |
29 |
30 |
31 | 点击获取
32 |
33 |
93 |
94 |
--------------------------------------------------------------------------------
/轮播图/img/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/1.jpg
--------------------------------------------------------------------------------
/轮播图/img/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/2.jpg
--------------------------------------------------------------------------------
/轮播图/img/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/3.jpg
--------------------------------------------------------------------------------
/轮播图/img/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/4.jpg
--------------------------------------------------------------------------------
/轮播图/img/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/5.jpg
--------------------------------------------------------------------------------
/轮播图/img/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/6.jpg
--------------------------------------------------------------------------------
/轮播图/img/l.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/l.png
--------------------------------------------------------------------------------
/轮播图/img/r.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raneenana/js_algorithm/658bb97e5de9bfcd495a1a105cc19e397cb30f11/轮播图/img/r.png
--------------------------------------------------------------------------------
/轮播图/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
16 |
17 |
18 |
38 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/过路口问题.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 算法1
6 |
7 |
8 |
28 |
29 |
--------------------------------------------------------------------------------
/递归.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/闭包选项卡.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
15 |
16 |
17 |
18 |
19 | - 注册字母邮箱
20 | - 注册手机号码邮箱
21 | - 注册VIP邮箱
22 |
23 |
24 |
25 | 略略略略略略略
26 |
27 |
28 | 注册手机号码邮箱
29 |
30 |
31 | 注册VIP邮箱
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/随机打乱一个数组.js:
--------------------------------------------------------------------------------
1 | const arr = [1,3,4,5];
2 | arr.sort(() => Math.random()*100-50)
3 | console.log(arr)
--------------------------------------------------------------------------------
/随机抽奖.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Document
6 |
7 |
8 | 您抽中的奖品是:
9 |
10 | 你还有3次机会
11 |
12 |
13 |
56 |
57 |
--------------------------------------------------------------------------------
/隔行变色.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 隔行变色
6 |
9 |
10 |
11 |
12 | 1
13 | 2
14 | 3
15 | 4
16 | 5
17 |
18 |
19 |
35 |
36 |
--------------------------------------------------------------------------------
/面向对象.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
23 |
24 |
25 |
--------------------------------------------------------------------------------