自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 ES6 Promise 用法讲解

Promise是一个构造函数,自己身上有all、reject、resolve这几个眼熟的方法,原型上有then、catch等同样很眼熟的方法。那就new一个var p = new Promise(function(resolve, reject){ //做一些异步操作 setTimeout(function(){ con...

2019-09-17 17:06:00 154

转载 vue中 关于$emit的用法(--父子组件传值--平行组件之间this.$store.commit)

组件是 vue.js 最强大的功能之一,而组件实例的作用域是相互独立的,这就意味着不同组件之间的数据无法相互引用。那么组件间如何通信,也就成为了vue中重点知识了。这篇文章将会通过props、$ref和 $emit 这几个知识点,来讲解如何实现父子组件间通信。在说如何实现通信之前,我们先来建两个组件father.vue和child.vue作为示例的基础。?...

2019-03-27 16:45:00 1083

转载 vue中 关于$emit的用法(父子组件传值)

1、父组件可以使用 props 把数据传给子组件。2、子组件可以使用 $emit 触发父组件的自定义事件。vm.$emit( event, arg ) //触发当前实例上的事件vm.$on( event, fn );//监听event事件后运行 fn; 例如:子组件: <template> <div class="train-city">...

2019-03-27 16:40:00 285

转载 JS字符串常用方法

动态方法:1、str.charAt(index); 返回子字符串,index为字符串下标,index取值范围[0,str.length-1]动态方法:2、str.charCodeAt(index); 返回子字符串的unicode编码,index取值范围同上静态方法:3、String.fromCharCode(num1,num2,...,numN); 根据unicode编码返...

2019-03-21 13:21:00 137

转载 js数组方法大全

JavaScript中创建数组有两种方式(一)使用 Array 构造函数:var arr1 = new Array(); //创建一个空数组var arr2 = new Array(20); // 创建一个包含20项的数组var arr3 = new Array("lily","lucy","Tom"); // 创建一个包含3个字符串的数组(二)使用数组字面量表示...

2019-03-21 13:15:00 134

转载 数字和字符串之间的转换,数组与字符串的相互转换方法

js字符串转换成数字将字符串转换成数字,得用到parseInt函数。parseInt(string) : 函数从string的开始解析,返回一个整数。举例:parseInt('123') : 返回 123(int);parseInt('1234xxx') : 返回 1234(int);如果解析不到数字,则将返回一个NaN的值,可以用isNaN()函数来检测;举例 :var i = par...

2019-03-19 20:22:00 347

转载 什么是跨域?怎么解决跨域问题?

什么是跨域?跨域,指的是浏览器不能执行其他网站的脚本。它是由浏览器的同源策略造成的,是浏览器施加的安全限制。所谓同源是指,域名,协议,端口均相同,不明白没关系,举个栗子:http://www.123.com/index.html 调用 http://www.123.com/server.php (非跨域)http://www.123.com/index.html 调用 http://ww...

2019-03-18 21:21:00 92

转载 JS数组去重的几种常见方法

一、简单的去重方法// 最简单数组去重法/** 新建一新数组,遍历传入数组,值不在新数组就push进该新数组中* IE8以下不支持数组的indexOf方法* */function uniq(array){ var temp = []; //一个新的临时数组 for(var i = 0; i < array.length; i++){ ...

2019-03-18 21:09:00 128

转载 textarea高度随内容撑高

(function($){ $.fn.autoTextarea = function(options) { var defaults={ maxHeight:null, minHeight:$(this).height() }; var opts = $.ext...

2018-08-27 13:52:00 136

转载 可伸缩布局方案flex

/**可伸缩布局方案* rem计算方式:设计图尺寸px / 100 = 实际rem 例: 100px = 1rem*/!function (window) { /* 设计图文档宽度 */ var docWidth = 1920; var doc = window.document, docEl = doc.documentElement,...

2018-07-24 14:35:00 155

转载 rem 自适应类

@media screen and (max-width:320px) { html { font-size: 32px }}@media screen and (min-width:321px) and (max-width:340px) { html { font-size: 34px }}@media screen and (mi...

2017-12-08 10:18:00 102

转载 判断手机还是pc

if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { window.location.href = "https://www.baidu.com/";} else {  //pc window.location.href = "http://news.baidu.com/...

2017-11-24 09:13:00 127

转载 屏幕自适应大小

resize(); $(window,document).resize(function(){ resize(); }); functionresize(){ varwidths=$(window).width()/$("body").width(); $("body").css({ transform:"scale("+widths+")", t...

2017-10-24 11:16:00 137

转载 css3 light

.i-project .i-art-wrap .light { cursor: pointer; position: absolute; left: -100%; top: 0; width: 100%; height: 100%; background-image: -webkit-lin...

2017-06-28 11:25:00 199

转载 banner鼠标交互动画

//banner鼠标交互动画 $(".layerTransform").on("mousemove", function(e){ var _this = $(this); var x = e.pageX; var y = e.pageY; //console.log(x); var w =...

2017-05-08 09:14:00 271

转载 background 线性渐变

原文链接:http://caibaojian.com/css3-background-gradient.html综上所述,线性渐变的兼容写法如下:·//code from http://caibaojian.com/css3-background-gradient.html.gradient{ background: #000000; backgrou...

2017-04-26 11:37:00 508

转载 HTML5 input file 打开很慢的问题

<input type="file" name="file" class="element" accept="image/jpg,image/jpeg,image/png">转载于:https://www.cnblogs.com/hlyin/p/6726087.html

2017-04-18 09:03:00 203

转载 js来回动画

setInterval(function(){ $(".m-capabilities-bg1 i,.m-capabilities-bg2 i,.m-capabilities-bg3 i").toggleClass('ani-learn'); $(".m-capabilities-bg4 dd").toggleClass('ani-p...

2017-04-17 11:27:00 208

转载 banner定时器

$(function(){ var index = 1; var ul_li = $('.banner_ul li'); var icon_li = $('.icon_ul li'); var img_length = $('.banner_ul li').length;;...

2017-04-12 15:59:00 131

转载 浏览器缩放resize

var timer = null; $(window).resize(function () { if(timer) { clearTimeout(timer) } else { setTimeout(mediaScreen, 500); } });转载于:https://www...

2017-04-12 15:18:00 264

转载 点击切换全屏与退出

$(".full-btn").click(function(){ if($(this).hasClass("cur")){ $(this).removeClass("cur"); }else{ $(this).addClass("cur"); }})$('.full-btn').click(function () { if (!...

2017-04-06 09:08:00 399

转载 记录我的案例

http://zhaof.testweb12.iecworld.com/web/http://bosi.testweb12.iecworld.com/web/http://sail.testweb12.iecworld.com/web/http://zhongh.testweb12.iecworld.com/web/http://letu.testweb12.iecwor...

2017-04-05 15:10:00 104

转载 添加或删除元素jq

<script type="text/javascript">var tent = '<div class="box02 cf"><input type="text" class="input text_ipt" /><input type="file" class="file_btn" onclick="changefile(this)" /&...

2017-04-05 14:43:00 106

转载 文字和图片等上下左右居中

<div class="" style="display: table;"> <div class="" style="display: table-cell;vertical-align: middle;text-align: center;border-radius: 50%;background: red;color: #fff;width: 60px;heigh...

2017-04-05 14:28:00 298

空空如也

空空如也

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

TA关注的人

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