摘要: JavaScript中创建数组有两种方式 (一)使用 Array 构造函数: (二)使用数组字面量表示法: 数组的方法有数组原型方法,也有从object对象继承来的方法,这里我们只介绍数组的原型方法,数组原型方法主要有以下这些: join()push()和pop()shift() 和 unshift 阅读全文
posted @ 2019-03-21 13:15 我是前端QQ942031558 阅读(132) 评论(0) 推荐(0)
摘要: js字符串转换成数字将字符串转换成数字,得用到parseInt函数。parseInt(string) : 函数从string的开始解析,返回一个整数。举例:parseInt('123') : 返回 123(int);parseInt('1234xxx') : 返回 1234(int);如果解析不到数 阅读全文
posted @ 2019-03-19 20:22 我是前端QQ942031558 阅读(1186) 评论(0) 推荐(0)
摘要: 什么是跨域?跨域,指的是浏览器不能执行其他网站的脚本。它是由浏览器的同源策略造成的,是浏览器施加的安全限制。所谓同源是指,域名,协议,端口均相同,不明白没关系,举个栗子:http://www.123.com/index.html 调用 http://www.123.com/server.php (非 阅读全文
posted @ 2019-03-18 21:21 我是前端QQ942031558 阅读(240) 评论(0) 推荐(0)
摘要: 一、简单的去重方法// 最简单数组去重法 /* * 新建一新数组,遍历传入数组,值不在新数组就push进该新数组中 * IE8以下不支持数组的indexOf方法 * */ function uniq(array){ var temp = []; //一个新的临时数组 for(var i = 0; i 阅读全文
posted @ 2019-03-18 21:09 我是前端QQ942031558 阅读(363) 评论(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 阅读(244) 评论(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 阅读(191) 评论(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 阅读(109) 评论(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 阅读(128) 评论(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 阅读(302) 评论(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 阅读(173) 评论(0) 推荐(0)