随笔分类 -  js

页面滚动的时候自动切换导航栏
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv 阅读全文
posted @ 2018-08-28 15:23 温温婉婉 阅读(1568) 评论(0) 推荐(0)
get set方法
摘要:private _isDragable = false; set isDraggable(val){ this._isDragable = val; } get isDraggable(){ return this._isDragable; } //使用方式:虽然它是一个方法,但是它是一个属性方法, 阅读全文
posted @ 2018-08-27 16:01 温温婉婉 阅读(170) 评论(0) 推荐(0)
iframe 解决一个父页面多个子页面导致的回退问题
摘要:iframe内嵌页面 阅读全文
posted @ 2018-05-09 15:15 温温婉婉 阅读(2999) 评论(0) 推荐(0)
typescript文件中 使用回调函数无法调用函数外的变量和方法的办法
摘要:util.ts class UtilService{ util( tis,callback:any ){ let num = 1; callback(tis,num); } } 使用该方法的文件 demo.ts class Demo{ //设置一个全局变量 count = 4; console.lo 阅读全文
posted @ 2018-01-11 19:46 温温婉婉 阅读(2061) 评论(0) 推荐(0)
foreach和map遍历
摘要:参考网址:http://www.cnblogs.com/jocyci/p/5508279.html 1.foreach : 理论上这个方法是没有返回值的,仅仅是遍历数组中的每一项,不对原来数组进行修改;但是我们可以自己通过数组的索引来修改原来的数组; var ary = [12,23,24,42,1 阅读全文
posted @ 2017-09-13 11:01 温温婉婉 阅读(510) 评论(0) 推荐(0)
小知识点
摘要:1、搜索与指定谓词定义的条件匹配的元素,然后返回整个 Array 中的第一个匹配项。 Array.find() eg: var arr = [{ id: 1, name: "aa" }, { id: 2, name: "bb" }, { id: 3, name: "cc"}]; arr.find(f 阅读全文
posted @ 2017-06-15 16:53 温温婉婉 阅读(113) 评论(0) 推荐(0)
条件判断
摘要:今天看到一段do{}while()的代码,如下 阅读全文
posted @ 2017-06-05 14:38 温温婉婉 阅读(140) 评论(0) 推荐(0)
我所理解的this的用法
摘要:以前看过一些讲的很深奥的有关于this的讲解,却一直没懂,直到看到阮一峰的blog,感觉有点理解了,在此记录下自己对this关键字的理解 阮一峰this关键字网址链接:http://www.ruanyifeng.com/blog/2010/04/using_this_keyword_in_javas 阅读全文
posted @ 2017-05-18 11:11 温温婉婉 阅读(227) 评论(0) 推荐(0)