2017年3月6日

提取行间事件

摘要: 提取事件 -为元素添加事件 如onclick事件,接收函数 两种方法 1、 function 函数名(){ ........ } oBtn.onclick=函数名; 2、 oBtn.onclick=function ()//匿名函数 { ........ }; window.onload 页面加载完 阅读全文

posted @ 2017-03-06 10:20 想要逆袭的学渣 阅读(245) 评论(0) 推荐(0) 编辑

2017年3月3日

函数传参

摘要: function show(num){ alert(num); } show(5); num是函数的参数,只是占一个位置,具体的值是看函数调用时传递的是多少,当函数中有一部分内容定不下来时,就用传参。 操作属性的方法有两种: 1、oTxt.value 2、oTxt['value'] 区别:一般情况下 阅读全文

posted @ 2017-03-03 14:52 想要逆袭的学渣 阅读(101) 评论(0) 推荐(0) 编辑

a链接加js和className

摘要: <a href="javascript:;">链接</a>比<a href="#">链接</a>好一点儿,点击的时候不会跳到页面顶端,里面很少放js代码 在js中对class修改时,必须写出className,其余的js和html都一致 阅读全文

posted @ 2017-03-03 14:35 想要逆袭的学渣 阅读(217) 评论(0) 推荐(0) 编辑

js函数

摘要: 重用:相同的代码只用一次。 函数名最好有意义,为了可读性高 function 函数名(){ 代码 }//定义 函数名();//调用 if判断: if(条件){ 语句1; } else{ 语句2; } 例子:当点击的时候 如果div是显示的,隐藏掉。或者,显示出来 如果div是显示的,oDiv.sty 阅读全文

posted @ 2017-03-03 14:31 想要逆袭的学渣 阅读(93) 评论(0) 推荐(0) 编辑

js基础

摘要: 布局:HTML+CSS 属性:确定修改哪些属性 事件:确定用户进行哪些操作 编写js:在事件中,用js来修改页面的样式 例子: 1、鼠标提示框: 属性:样式的display,obj.style.[.......] 事件:onmouseover、onmouseout 具体:鼠标移入到input时,di 阅读全文

posted @ 2017-03-03 13:58 想要逆袭的学渣 阅读(62) 评论(0) 推荐(0) 编辑

2017年2月16日

四边参数值的设定

摘要: border,margin,padding 拿border举例 border:上,右,下,左。 border:上下,左右。 border:上下左右。 border:上,左右,下。 阅读全文

posted @ 2017-02-16 10:20 想要逆袭的学渣 阅读(85) 评论(0) 推荐(0) 编辑

命名规范

摘要: 转载自https://www.douban.com/group/topic/2359257/ 头:header 内容:content/container 尾:footer 导航:nav 侧栏:sidebar 栏目:column 页面外围控制整体布局宽度:wrapper 左右中:left right 阅读全文

posted @ 2017-02-16 10:14 想要逆袭的学渣 阅读(82) 评论(0) 推荐(0) 编辑

属性选择器

摘要: 1、[attribute] a[target]{background-color:yellow;} <a href="#">aaa</a> <a href="#" target="_blank">bbb</a> 2、[attribute=value] a[target=_blank]{backgro 阅读全文

posted @ 2017-02-16 10:02 想要逆袭的学渣 阅读(93) 评论(0) 推荐(0) 编辑

优先级

摘要: id,class,td还有html里的样式优先级问题。。。 #bgGreen{ } .bgRed{ background-color: Red; } td{ background-color: Black; } <table> <tbody> <tr> <td class="bgRed" id="b 阅读全文

posted @ 2017-02-16 09:10 想要逆袭的学渣 阅读(89) 评论(0) 推荐(0) 编辑

导航