12 2021 档案

摘要:遇到的问题: 放大镜案例中,隐藏放大镜,当鼠标进入需要放大的盒子里面时显示放大镜,原本放大镜不会超出盒子的临界值,但是隐藏后再显示就超出了。 原因: offsetWidth和offsetLeft不能获取隐藏元素的宽高导致放大镜的最大临界值和最小临界值获取不正确。 解决办法: 需要获取隐藏和显示的盒子 阅读全文
posted @ 2021-12-27 21:01 4zero4NotFound 阅读(158) 评论(0) 推荐(0) 编辑
摘要:var res = "地址"; var arr = res.split('?'); console.log(arr); // var str = arr[1]; // console.log(str); // var arr = str.split('&'); // console.log(arr) 阅读全文
posted @ 2021-12-25 17:15 4zero4NotFound 阅读(36) 评论(0) 推荐(0) 编辑
摘要:防抖 防抖的含义就是让某个时间期限内,事件处理函数只执行一次。 // 防抖 var top = document.querySelectorAll(".tpo"); var t; top.addEventListener('click', function () { clearInterval(t) 阅读全文
posted @ 2021-12-22 20:56 4zero4NotFound 阅读(31) 评论(0) 推荐(0) 编辑
摘要:标签内容: <div class="box1"></div> <div class="box2"></div> var box1 = document.querySelector(".box1"); box1.innerHTML = "<span>你好</span>"; //你好 var box2 阅读全文
posted @ 2021-12-22 20:44 4zero4NotFound 阅读(36) 评论(0) 推荐(0) 编辑
摘要:<style> * { margin: 0; padding: 0; } h1 { width: 700px; margin: 100px auto 10px; } div { width: 700px; min-height: 30px; margin: 0 auto; } #hd { width 阅读全文
posted @ 2021-12-21 11:16 4zero4NotFound 阅读(34) 评论(0) 推荐(0) 编辑
摘要:<body> <table> <thead> <tr> <th>周天</th> <th>周一</th> <th>周二</th> <th>周三</th> <th>周四</th> <th>周五</th> <th>周六</th> </tr> </thead> <tbody id="tb"></tbody> 阅读全文
posted @ 2021-12-18 14:31 4zero4NotFound 阅读(24) 评论(0) 推荐(0) 编辑
摘要:html代码: <div class="bar"> <div class="line"> <div class="dot"></div> </div> </div> //js: // 获取进度条 var bar = document.querySelector(".bar"); var line = 阅读全文
posted @ 2021-12-11 10:18 4zero4NotFound 阅读(45) 评论(0) 推荐(0) 编辑
摘要:html代码: <input type="text" id="year"> <input type="text" id="month"> <input type="text" id="day"> <button id="btn">提交</button> js代码: var year = docume 阅读全文
posted @ 2021-12-08 17:37 4zero4NotFound 阅读(280) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示