摘要: <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv= 阅读全文
posted @ 2020-04-07 20:19 花木兰r 阅读(99) 评论(0) 推荐(0) 编辑
摘要: // 获取元素 var box = my$('box'); var screen = box.children[0]; var ul = screen.children[0]; var ol = screen.children[1]; // 箭头 arrow var arr = my$('arr') 阅读全文
posted @ 2020-04-07 19:08 花木兰r 阅读(103) 评论(0) 推荐(0) 编辑
摘要: // var timerId = null;// 封装动画的函数function animate(element, target) { // 通过判断,保证页面上只有一个定时器在执行动画 if (element.timerId) { clearInterval(element.timerId); e 阅读全文
posted @ 2020-04-07 19:04 花木兰r 阅读(133) 评论(0) 推荐(0) 编辑
摘要: // 获取元素var bodyTop = document.getElementById("top");// 回到顶部的按钮var totop = document.getElementById("totop");// top 是window自带的一个属性,此属性是只读的。此属性默认是window对 阅读全文
posted @ 2020-04-07 18:59 花木兰r 阅读(309) 评论(0) 推荐(0) 编辑
摘要: var timerId = null; // 封装动画的函数 function animate(element, target) { // 通过判断,保证页面上只有一个定时器在执行动画 if (timerId) { clearInterval(timerId); timerId = null; } 阅读全文
posted @ 2020-04-07 18:18 花木兰r 阅读(203) 评论(0) 推荐(0) 编辑
摘要: <script> var box = my$('box'); var content = my$('content'); var scroll = my$('scroll'); var bar = my$('bar'); //1 根据内容的大小,计算滚动条的高度 // 滚动条的高度 / scroll 阅读全文
posted @ 2020-04-07 18:15 花木兰r 阅读(172) 评论(0) 推荐(0) 编辑
摘要: var box = my$('box'); var smallBox = box.children[0]; var bigBox = box.children[1]; var smallImage = smallBox.children[0]; var mask = smallBox.childre 阅读全文
posted @ 2020-04-07 18:11 花木兰r 阅读(91) 评论(0) 推荐(0) 编辑
摘要: var btn = document.getElementById('btn'); btn.onclick = function () { // console.log(location.href); // location.href = 'http://www.itheima.com'; // a 阅读全文
posted @ 2020-04-07 17:26 花木兰r 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1:添加cookie document.cookie = " user = name "; document.cookie = " pass = 123456 "; 2: 设置过期时间:expires = 时间 var oDate = new Date(); oDate.setDate(oDate. 阅读全文
posted @ 2020-04-07 16:16 花木兰r 阅读(105) 评论(0) 推荐(0) 编辑
摘要: var box = document.getElementById('d_box'); var drop = document.getElementById('drop'); var box_close = document.getElementById('box_close'); drop.onm 阅读全文
posted @ 2020-04-07 11:36 花木兰r 阅读(120) 评论(0) 推荐(0) 编辑