摘要: 一百多行代码。 这两天仿照fragmentfault上面写的。 大家帮我看看有啥bug 阅读全文
posted @ 2015-03-10 17:52 cheerfulCoder 阅读(6904) 评论(4) 推荐(5) 编辑
摘要: [图解]在输入框和文本框中获取和设置光标位置,以及选中文本和获取选中文本值的方法 --- 详解,兼容所有浏览器。 阅读全文
posted @ 2015-03-09 16:42 cheerfulCoder 阅读(10580) 评论(7) 推荐(4) 编辑
摘要: 关于鼠标事件的screenY,pageY,clientY,layerY,offsetY属性 阅读全文
posted @ 2015-03-04 20:45 cheerfulCoder 阅读(4326) 评论(3) 推荐(1) 编辑
摘要: 设置宽高比在很多时候是有用的。下面的栗子,我们设置一个容器的宽高比为16:9//HTML代码片段 content //css 代码 div{ border: 1px solid green; ... 阅读全文
posted @ 2014-11-13 13:31 cheerfulCoder 阅读(4365) 评论(0) 推荐(1) 编辑
摘要: 写在前面: 先讲讲ajax中的相关函数,然后结合函数功能来具体分析源代码。 相关函数: >>ajax全局事件处理程序 .ajaxStart(handler) 注册一个ajaxStart事件处理器。当一个Ajax请求开始,并且同时无其它未完成的Ajax请求时,jQuery触发ajaxStart事件。 .ajaxSend(... 阅读全文
posted @ 2014-10-24 09:30 cheerfulCoder 阅读(1892) 评论(0) 推荐(0) 编辑
摘要: /* -----------ajax模块开始 -----------*/ var // Document location ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(), ajax_rquery = /\?/, rhash = /#.*$/, rts = /([?&])_=... 阅读全文
posted @ 2014-10-23 23:25 cheerfulCoder 阅读(1665) 评论(0) 推荐(0) 编辑
摘要: html5 自定义数据属性 ,也就是 data-* 自定义属性。 例如 可以有三种方法访问和修改data: 1.使用getAttribute setAttribute 方法 例如 div.getAttribute("data-last-value") 2.使用datase... 阅读全文
posted @ 2014-08-13 11:54 cheerfulCoder 阅读(1141) 评论(0) 推荐(0) 编辑
摘要: client/scroll/offset width/height/top/left (盒模型为contentBox,定位原点是元素左上角边框最外层的交点) clientWidth width+左padding+右padding(如果有竖滚动条,那么要减去17px) clientHeigh... 阅读全文
posted @ 2014-08-10 15:49 cheerfulCoder 阅读(472) 评论(0) 推荐(0) 编辑