摘要: 获取日期的指定部分: var date =new Date(); //获取日期对象 console.log(date.getFullYear() + "年");//获取年 console.log((date.getMonth() + 1) + "月");//获取月函数默认是0~11 所以要+1 co 阅读全文
posted @ 2016-01-27 14:52 inethard 阅读(150) 评论(0) 推荐(0) 编辑
摘要: JavaScript中,一切都是对象,判断一个变量是不是对象非常简单。值类型的类型判断用typeof,引用类型的类型判断用instanceof。数组是对象,函数是对象,对象还是对象。对象都是通过函数来创建的:对象是函数创建的,而函数却又是一种对象。JavaScript默认的给函数一个属性——prot... 阅读全文
posted @ 2016-01-26 17:42 inethard 阅读(99) 评论(0) 推荐(0) 编辑
摘要: for (var i=0;i<100;i++) { oBtn[i].onclick=function(){ alert(i); }; } 点击后统一弹出'99':绑定事件后,点击时触发事件,此时事件全部绑定完毕,i===99。 阻止冒泡: element.onclick=function(e){ / 阅读全文
posted @ 2016-01-19 21:26 inethard 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 图片轮播 z-index方法 &lt; &gt; 阅读全文
posted @ 2016-01-17 18:19 inethard 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 结构: &lt; &gt;CSS: *{ margin: 0; ... 阅读全文
posted @ 2016-01-17 14:26 inethard 阅读(167) 评论(0) 推荐(0) 编辑
摘要: CSS:width:40px; height:40px; position:fixed; left:50%; display:none; margin-left:页面宽度/2; bottom:30px;JavaScript:window.onload=funct... 阅读全文
posted @ 2016-01-17 13:25 inethard 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 框架: 热点 财经 科技 娱乐 游戏 CSS要点:noticeTitle为relative,noticeTitle下的ul为absolute,noticeTitle下的ul需要left:-1px,用来使首个选项卡的左border与noticeTitle的左... 阅读全文
posted @ 2016-01-14 19:03 inethard 阅读(171) 评论(0) 推荐(0) 编辑
摘要: *Element.style.width(height)只能获取HTML中的宽和高(无法获取CSS中的样式),并且宽和高为带'px'的字符串*Element.offsetHeight(offsetWidth)需要在该元素插入HTML中之后(新创建的元素)才能获取到遮罩层与弹出层(登录框)使用fixe... 阅读全文
posted @ 2016-01-07 14:45 inethard 阅读(329) 评论(0) 推荐(0) 编辑