摘要: 一、简单的去重方法// 最简单数组去重法 /* * 新建一新数组,遍历传入数组,值不在新数组就push进该新数组中 * IE8以下不支持数组的indexOf方法 * */ function uniq(array){ var temp = []; //一个新的临时数组 for(var i = 0; i 阅读全文
posted @ 2019-03-18 21:09 我是前端QQ942031558 阅读(349) 评论(0) 推荐(0) 编辑
摘要: (function($){ $.fn.autoTextarea = function(options) { var defaults={ maxHeight:null, minHeight:$(this).height() }; var opts = $.extend({},defaults,opt 阅读全文
posted @ 2018-08-27 13:52 我是前端QQ942031558 阅读(229) 评论(0) 推荐(0) 编辑
摘要: /**可伸缩布局方案 * rem计算方式:设计图尺寸px / 100 = 实际rem 例: 100px = 1rem */!function (window) { /* 设计图文档宽度 */ var docWidth = 1920; var doc = window.document, docEl 阅读全文
posted @ 2018-07-24 14:35 我是前端QQ942031558 阅读(186) 评论(0) 推荐(0) 编辑
摘要: @media screen and (max-width:320px) { html { font-size: 32px }}@media screen and (min-width:321px) and (max-width:340px) { html { font-size: 34px }}@m 阅读全文
posted @ 2017-12-08 10:18 我是前端QQ942031558 阅读(105) 评论(0) 推荐(0) 编辑
摘要: if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) { window.location.href = "https://www.baidu.com/"; } else { //pc window.location 阅读全文
posted @ 2017-11-24 09:13 我是前端QQ942031558 阅读(123) 评论(0) 推荐(0) 编辑
摘要: resize(); $(window,document).resize(function(){ resize(); }); function resize(){ var widths = $(window).width()/$("body").width(); $("body").css({ tra 阅读全文
posted @ 2017-10-24 11:16 我是前端QQ942031558 阅读(294) 评论(0) 推荐(0) 编辑
摘要: .i-project .i-art-wrap .light { cursor: pointer; position: absolute; left: -100%; top: 0; width: 100%; height: 100%; background-image: -webkit-linear- 阅读全文
posted @ 2017-06-28 11:25 我是前端QQ942031558 阅读(168) 评论(0) 推荐(0) 编辑
摘要: //banner鼠标交互动画 $(".layerTransform").on("mousemove", function(e){ var _this = $(this); var x = e.pageX; var y = e.pageY; //console.log(x); var w = _thi 阅读全文
posted @ 2017-05-08 09:14 我是前端QQ942031558 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://caibaojian.com/css3-background-gradient.html 综上所述,线性渐变的兼容写法如下:· 来源:前端开发博客 阅读全文
posted @ 2017-04-26 11:37 我是前端QQ942031558 阅读(302) 评论(0) 推荐(0) 编辑
摘要: <input type="file" name="file" class="element" accept="image/jpg,image/jpeg,image/png"> 阅读全文
posted @ 2017-04-18 09:03 我是前端QQ942031558 阅读(153) 评论(0) 推荐(0) 编辑