自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 es6 类实例属性的两种写法

es6 类实例属性的两种写法带参数可以传参,但是要多写一个constructorclass Person { constructor(name, age) { this.name = name this.age = age } speak() { console.log(`my name is ${this.name}, I am ${this.age} years o...

2020-04-20 11:13:05 558 1

原创 不使用new 运算符,尽可能找到获取对象的方法

var o = {}var o = function() {}// 使用Object构造器var o = new Object();// 使用function var o = new function f(){};// 使用methodvar o = Object.create(null);// 使用 ES6 classclass myObj { construc...

2020-01-08 15:41:20 297

原创 方法

/***@description向上找需要的父元素*@paramele初始元素*@paramtagname目标父元素的标签名*/exportfunctionfindParentEle(ele,tgName){if(!ele){returndocument.body}constparentEle=e...

2019-11-22 17:20:22 136

转载 框架模板

分享一些后管模版,包含bootstrap、vue、react、angular等主流框架

2019-08-22 11:59:33 97

转载 使用 local storage 存储页面产生的数据结果

https://www.sunzhongwei.com/using-local-storage-save-page-data-results

2019-08-16 10:42:15 292

转载 scrollTop、offsetHeight和offsetTop

下面有每个属性详细的解释网页可见区域宽:document.body.clientWidth网页可见区域高:document.body.clientHeight网页可见区域宽:document.body.offsetWidth (包括边线的宽)网页可见区域高:document.body.offsetHeight (包括边线的宽)网页正文全文宽:document.body.scrol...

2019-08-16 10:32:10 168

原创 Window 尺寸

有三种方法能够确定浏览器窗口的尺寸。对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari:window.innerHeight - 浏览器窗口的内部高度(包括滚动条) window.innerWidth - 浏览器窗口的内部宽度(包括滚动条)对于 Internet Explorer 8、7、6、5:document.documentE...

2019-08-16 10:20:45 199

转载 js常用的各种宽高clientHeight、scrollHeight、offsetHeight

一、宽高 (1)clientHeight、clientWidth→元素宽高(height+padding,不包含边框),可以理解为元素可视区域高度 (2)offsetHeight、offectWidth→元素宽高(height+padding+border,包含边框),可以理解为元素的可视高度 (3)scrollHeight、scrollWidth→元素宽高(内容的实...

2019-08-16 10:11:03 341

转载 javascript时间戳和日期字符串相互转换

"http://www.w3.org/1999/xhtml">"Content-Type" content="text/html; charset=utf-8" />"text/javascript">// 获取当前时间戳(以s为单位)var timestamp = Date.parse(new Date());timestamp = timestamp / 1000;//当前时间戳

2017-08-24 12:14:52 218

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除