摘要: An Introduction To LESS, And Comparison To SassI’ve been usingLESSreligiously ever since I stumbled upon it months ago. CSS was never really a problem for me, in and of itself, but I was intrigued by the idea of using variables to create something along the lines of a color palette for my websites a 阅读全文
posted @ 2011-09-18 13:44 高凡凡高 阅读(610) 评论(0) 推荐(0) 编辑
摘要: A Music Box Based on HTML5 and CSS3Queen - Love of My Life01:30----------02:01PrevPausePlayNextMuteAll Songs Queen - Love of my life Queen - Love of my life Queen - Love of my life Queen - Love of my life Queen - Love of my life Queen - Love of my life Queen - Love of my ... 阅读全文
posted @ 2011-09-08 23:08 高凡凡高 阅读(281) 评论(1) 推荐(0) 编辑
摘要: 在使用JavaScript脚本获取元素的尺寸时,有几个属性你需要弄清楚,不然会很棘手。 在以往我都是对这些属性死记硬背,很少真正理解过,忘记了就查手册。看完本文我相信这种情况就不会再发生了。 元素占据的物理空间的尺寸 如果你需要获得元素占据的物理空间,那么使用offsetHeight和offsetWidth。 自然而然此物理空间必然包含的有:padding、滚动条、border。 这两个属性与getBoundingClientRect()的height和width属性是一致的。 阅读全文
posted @ 2011-09-06 21:52 高凡凡高 阅读(764) 评论(3) 推荐(2) 编辑
摘要: camelCase函数的功能就是将形如background-color转化为驼峰表示法:backgroundColor。此函数在jQuery的data函数,以及涉及到css的诸多函数中都有用到。 阅读全文
posted @ 2011-09-04 18:31 高凡凡高 阅读(2062) 评论(0) 推荐(1) 编辑
摘要: 之前基于jQuery山寨了一个新浪轻博客的标签列表,demo请看这里。 后来又加入了编辑功能,类似美味书签。 大致的效果就是点击一个已输入的标签,选中该标签,然后可以对该标签进行编辑。 因为存储标签的名称使用的是div元素,所以这里涉及到的难点主要有: 1)如何使div元素能够被选中; 2)如何使div元素支持编辑功能; 3)因为标签不能重复,所以修改以后使用onblur事件进行验证; 阅读全文
posted @ 2011-09-03 19:48 高凡凡高 阅读(971) 评论(0) 推荐(1) 编辑
摘要: 前言 jQuery.extend函数是jQuery的核心函数之一,在官方API文档视图中它位于core栏目下的plugins中。顾名思义,extend函数的主要目的就是用来扩展jQuery的功能。因此如果需要基于jQuery编写插件,那么掌握这个函数是必不可少的。不仅如此,jQeury内部许多函数和方法都离不开它,足以证明jQuery.extend的重要性。 功能 合并一个或多个对象的属性到目标对象 使用 jQuery.extend ( [deep] , target , source1 , source2 , ...[sourceN] ); 参数说明 deep指定是深拷贝-true还是浅拷贝-false(是否使用递归),默认是浅拷贝 target是目标对象 source属性来源参数,用于扩展目标对象 额外说明:如果只有一个参数则直接扩展jQuery对象 阅读全文
posted @ 2011-09-01 21:30 高凡凡高 阅读(322) 评论(0) 推荐(1) 编辑
摘要: 注明:未列出常见的比如document.getElementById(),object.addEventListener()等。 document.activeElement 获取文档当前获得焦点的元素 document.head 在jQuery中使用方式如下document.head || document.getElementsByTagName( "head" )[0] ,可见并非所有浏览器支持 document.body 获得当前文档的HTMLBodyElement元素 document.compatMode 获取当前文档的渲染方式。返回值:BackCompat(怪癖模式)和CSS1Compat(标准模式)。 由于IE 8多达五种渲染模式,所以判断是否是怪癖模式需要借助于IE独有的document.documentMode进行额外检测 参见此文http://www.cnblogs.com/rubylouvre/archive/2009/09/05/1559883.html 阅读全文
posted @ 2011-08-30 21:41 高凡凡高 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 把你的大脑当做浏览器执行下面的代码两次,分别是IE6和IE9: function testFunc(){ alert('test') } $(function(){ var g = document.getElementById , w = window.testFunc ; //g alert(typeof(g)); alert(String(g)); alert(g instanceof Object); alert(g instanceof Function); //w alert(typeof(w)); alert(String(w)); alert(w instanceof Object); alert(w instanceof Function); //执行 alert(g('t')); w(); }); 阅读全文
posted @ 2011-08-20 11:37 高凡凡高 阅读(2245) 评论(1) 推荐(0) 编辑
摘要: <!doctypehtml><head></head><body><spanid="con">xxx</span><script>varcss=document.createElement('style');css.setAttribute('type','text/css');varcssText='span{color:Red;}';if(css.styleSheet){//IEcss.styleSheet.cssText= 阅读全文
posted @ 2011-08-17 10:17 高凡凡高 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 无废话,直接上代码:/**jQueryxmlDOMPluginv1.0*http://outwestmedia.com/jquery-plugins/xmldom/**Released:2009-04-06*Version:1.0**Copyright(c)2009JonathanSharp,OutWestMediaLLC.*DuallicensedundertheMITandGPLlicenses.*http://docs.jquery.com/License*/(function($){if(window['DOMParser']==undefined&&w 阅读全文
posted @ 2011-08-16 19:56 高凡凡高 阅读(435) 评论(0) 推荐(0) 编辑