上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 44 下一页
摘要: offset翻译过来就是偏移量,我们使用offset系列相关属性可以动态的得到该元素的位置(偏移)、大小等。 ●获得元素距离带有定位父元素的位置 ●获得元素自身的大小(宽度高度) ●注意:返回的数值都不带单位 <style> .father { width: 500px; height: 500px 阅读全文
posted @ 2022-04-18 13:41 罗砂 阅读(63) 评论(0) 推荐(0)
摘要: <body> <button>点击我</button> </body> <script> // location对象方法; // location.assign() 跟href一样,可以跳转页面(也称为重定向页面) // location.replace() 替换当前页面,因为不记录历史,所以不能后 阅读全文
posted @ 2022-04-18 13:25 罗砂 阅读(167) 评论(0) 推荐(0)
摘要: 第一个页面 <body> <form action="11.5获取URL参数跨页面输入.html"> 用户名: <input type="text " name="uname" /> <input type="submit" value="登录" /> </form> </body> 第二个页面 < 阅读全文
posted @ 2022-04-18 13:24 罗砂 阅读(46) 评论(0) 推荐(0)
摘要: <body> <button>跳转</button> <div></div> </body> <script> var btn = document.querySelector("button"); var div = document.querySelector("div"); btn.addEv 阅读全文
posted @ 2022-04-18 13:22 罗砂 阅读(29) 评论(0) 推荐(0)
摘要: 同步 是一个一个执行的 异步 是很多个同时执行的 他们的区别就是执行顺序不同 阅读全文
posted @ 2022-04-18 13:21 罗砂 阅读(33) 评论(0) 推荐(0)
摘要: <body> <button>发送</button> </body> <script> var btn = document.querySelector("button"); var time = 3; //定义剩下的秒数 btn.addEventListener("click", function 阅读全文
posted @ 2022-04-18 13:21 罗砂 阅读(35) 评论(0) 推荐(0)
摘要: 清除定时器clearInterval: <body> <button class="kai">开启定时器</button> <button class="guan">关闭定时器</button> </body> <script> var begin = document.querySelector( 阅读全文
posted @ 2022-04-18 13:20 罗砂 阅读(188) 评论(0) 推荐(0)
摘要: <style> div { width: 400px; height: 200px; background-color: cornsilk; } span { float: left; margin-right: 10px; background-color: black; width: 50px; 阅读全文
posted @ 2022-04-18 13:19 罗砂 阅读(144) 评论(0) 推荐(0)
摘要: 以毫秒的计算 定时器setTimeout( ) <script> // 以毫秒的计算 定时器setTimeout( ) // 第一种方法 setTimeout(function () { console.log("三秒钟到了"); }, 3000); </script> <script> // 第二 阅读全文
posted @ 2022-04-18 13:11 罗砂 阅读(66) 评论(0) 推荐(0)
摘要: window.onresize是调整窗口大小加载事件,当触发时就调用的处理函数 注意 1.只要窗口大小发生像素变化,就会触发这个事件 2.我们经常利用这个事件完成响应式布局。window.innerWidth 当前屏幕的宽度 <script> // window.onresize是调整窗口大小加载事 阅读全文
posted @ 2022-04-18 13:10 罗砂 阅读(172) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 44 下一页