- 博客(10)
- 收藏
- 关注
原创 留言板案例
<style> *{margin:0;padding:0;} .cont{ width:600px; height:500px; border:1px solid #cccc; margin:100px auto; position:relative; } .list{ margin-le.
2020-08-17 21:47:46 222
原创 你了解http请求吗,说说请求头里有什么
一个HTTP请求报文由请求行(request line)、请求头部(header)、空行和请求数据4个部分组成 请求头里有:请求的地址,请求方式,服务器发回的响应状态代码,远程地址 , 请求约束
2020-08-16 22:46:15 1695
原创 简单说说闭包,以及闭包的应用场景
1.函数在执行时,可以拿到自身的定义作用域内的变量 2.触发了垃圾回收机制,将暂时不用的数据,暂存起来,如果需要使用,可以再次调出,除非真正不用了,再进行删除 应用场景:事件委托的封装 循环绑定事件,事件中使用循环的计数器 内置函数的回调函数传参 ...
2020-08-15 17:23:01 216
原创 函数的调用方式
函数模式 直接调用函数的方式,this指向的全局对象window. function fn() { console.log(123) } fn() 方法模式 函数作为对象的方法调用,this指向当前的对象. var o = { prop: 21, f:function() { return this.prop; } }; console.log(o.f()); 构造器模式 通过new调用构造器的方式,this指向当前构造函数的原型. func..
2020-08-14 22:53:50 230
原创 px em rem的区别
px em rem的区别 px是固定的像素,一旦设置了就无法因为适应页面大小而改变。 em的值不是固定的,会继承父元素的字体大小 rem的大小是根据html根目录下的字体大小进行计算的
2020-08-12 21:53:51 158
原创 面对对象搜索框
<body> <input type="text" id="txt"> <ul class="list"></ul> <script src="ajax.js"></script> <script> // https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=&cb=jsaydaud class Se
2020-08-03 21:57:25 184
原创 js实现轮播图案例
js实现轮播图 <style> * {margin:0; padding:0; list-style:none;} .box {width:850px; height:500px; margin:50px auto; overflow:hidden; position:relative;} .box ul {position:absolute;left: 0;top: 0;} .box ul li{heigh
2020-08-02 17:38:43 155
原创 js面向对象轮播图案例
轮播图案例 <style> .cont{width:1000px;height:300px;position: relative;margin: 50px auto;overflow: hidden;} .imgbox a{position: absolute;left:1000px;top:0;} .imgbox a:nth-child(1){left:0} .imgbox img{width:1000px;height:300px;} .
2020-08-02 17:07:12 175
原创 js放大镜案例
放大镜案例 <style> .smallBox{ width:400px; height:300px; float:left; margin:50px; position:relative; } .smallBox img{ width:400px; height:300px; } .bigBox{ width:400px;
2020-08-01 09:58:10 128
原创 css定位哪几种方式
css定位有哪几种 1.position:static;默认值 2.position: absolute;绝对定位 3.position:relative;相对定位 4.position:fixed;固定定位 5.position:sticky;粘性定位 特征 position:static; 默认值,设置坐标无效 position: absolute; 1:脱离文档流,占位置 ...
2020-03-21 18:45:20 509 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人