web
绵洋的PhD之路
煲汤中...
展开
-
BFC原理与清除浮动的关系
1. BFC(Block Formatting Context) 规定了块级盒子(block-level box)格式化的规则,是一个独立的渲染区域,且这个区域与外部不相关。2. 哪些元素会生成BFC 根元素;float不等于none;position:absolute or fixed;display:inline-block, table-cell, table原创 2017-07-29 10:10:08 · 744 阅读 · 0 评论 -
<a>标签来响应onclick事件
建议使用下面三种方法 1.JavaScript:void(0)" onclick="doSomething()">test 2.test 3.test转载 2017-08-05 17:01:52 · 530 阅读 · 0 评论 -
box-sizing属性
box-sizing即盒子模型的大小box-sizing:content-box和border-box;content-box=width+padding-width+border-width+margin-width;(width=content-width, 设置的宽度为内容填充的实际宽度);border-box=width+margin-width;(width=co原创 2017-07-27 18:09:00 · 157 阅读 · 0 评论 -
字符串
ES6新增字符串表示方法多行字符串, 表示方法:`...`;字符串模板,表示方法:`你好,${name},你今年,${age}`;需要特别注意的是,字符串是不可变的,如果对字符串的某个索引赋值,不会有任何错误,但是,也没有任何效果相关函数:.indexof(s),指定字符串出现的位置;.substring(m,n),返回索引区间内的字符串;,原创 2017-07-02 23:33:59 · 200 阅读 · 0 评论 -
Javascript再改造(1)——数据类型和变量
1. Number类型:整型、浮点型、科学计算表示法、负数、NaN、Infinity2. “==”与‘’===“的区别:前者会自动转换数据类型再比较,后者不会转换数据类型,最好坚持使用“===”比较;3. NaN是特殊Number,与其他值均不相等,包括其本身:NaN===NaN false!4. null 表示“空”,与0和字符串“”不同,“”表示长度为0原创 2017-06-29 22:26:37 · 175 阅读 · 0 评论 -
JS实现弹出框文字居中
jscript.dom.layerCenterH=function(inObj){//设置水平居中 var lca; var lcb; var lcx; var iebody; var dsocleft; if(window.innerWidth){ lca=window.innerWidth; //窗口的文档显示区宽度原创 2017-03-16 19:07:25 · 1455 阅读 · 0 评论 -
JS中关于clientWidth offsetWidth scrollWidth 等的含义
网页可见区域宽: document.body.clientWidth;网页可见区域高: document.body.clientHeight;网页可见区域宽: document.body.offsetWidth (包括边线的宽);网页可见区域高: document.body.offsetHeight (包括边线的宽);网页正文全文宽: document.body.scroll转载 2017-03-07 17:08:31 · 159 阅读 · 0 评论 -
构建jscript.debug包
知识点:for...in 语句用于遍历数组或者对象的属性jscript.debug.enumProps=function(inObj){ var props=""; var i; for(i in inObj){ props+=i+"="+inObj[i]+"\n"; } alert(props);}原创 2017-03-06 21:02:41 · 245 阅读 · 0 评论 -
JQuery的html元素捕获、设置、元素添加与删除
JQuery效果-显示与隐藏$(selector).hide(time,callback) callback为回调函数$(selector).show(time,callback)$(selector).toggle(time,callback)JQuery效果-淡入淡出$(selector).fadein(同上)$(selector).fadeout()$(s原创 2015-12-01 10:18:25 · 191 阅读 · 0 评论 -
HTML5表单新增元素与属性
属性: form 将元素的form属性指向一个id,那么该元素从属于此id formaction 不用的按钮可提交到不同的页面 formmethod 以不同的方法提交 例如 get post formenctype 对表单元素指定不同的编码方式 : text/plain multipart/ form-data formtarget -blank -原创 2015-11-18 09:38:33 · 206 阅读 · 0 评论 -
html中字体英文
宋体SimSun黑体SimHei微软雅黑Microsoft YaHei微软正黑体Microsoft JhengHei新宋体NSimSun新细明体PMingLiU细明体MingLiU标楷体DFKai-SB仿宋FangSong楷体KaiTi仿宋转载 2015-11-21 20:02:06 · 1670 阅读 · 0 评论 -
CSS-页面特效
2D/3D特效 transform:att(); -webkit-transform:att() //safari chrome浏览器的适应 -o-transform:att()//opera -ms-transform:att()//IE -moz-transform:att()//firefox2D:translate()移动; rotate()翻转; scale()缩放;原创 2015-11-11 10:50:34 · 361 阅读 · 0 评论 -
CSS3选择器(二)
选择器:first-child last-child nth-child nth-last-childatt:first-child:元素中的第一个子元素att:last-child:元素中的最后一个子元素att:nth-child(position):正position位被选中att:nth-last-child(position):倒数第position位被选中(odd/ev原创 2015-11-11 10:49:40 · 252 阅读 · 0 评论 -
js函数调用时,加括号与不加括号的区别
概念:函数名其实就是指向函数体的指针 a.onclik=func; //会等待响应事件;a.onclick=func();//函数会立即执行,并将func的返回值赋值给onclick;转载 2017-08-07 11:42:38 · 272 阅读 · 0 评论