摘要: 1).没有嵌套 1.后来居上 2.数值大的在上面 2).有嵌套 --> 前提是z-index为数值,不是auto <div position="relative" z-index=1> <img position="relative" z-index=2/> </div> <div position 阅读全文
posted @ 2016-04-25 16:47 tu-l 阅读(123) 评论(0) 推荐(0) 编辑
摘要: <div id="abs"> <img id="abs-img" src="img/abs.jpg"/> </div> 1.absolute相对于临近有定位的父元素移动 2.包裹性,当id="abs"的div定位为absolute,该div的大小适应图片大小,全靠图片支撑 3.破坏性,当id="ab 阅读全文
posted @ 2016-03-03 14:27 tu-l 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 由于浏览器安全模型的同源策略,ajax存在跨域问题。 解决跨域问题: 1.服务器代理 a.com中: 页面 --> $.post( 'http://a.com/proxy.php', ..) proxy.php --> $url="http://b.com/send.php?"; //b.com的接 阅读全文
posted @ 2016-03-01 16:08 tu-l 阅读(113) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/2050/archive/2012/08/13/2636467.html#2457812 阅读全文
posted @ 2016-02-22 16:21 tu-l 阅读(696) 评论(0) 推荐(0) 编辑
摘要: http://blog.163.com/wp_design/blog/static/13999717120120295198574/ 阅读全文
posted @ 2016-02-22 16:14 tu-l 阅读(125) 评论(0) 推荐(0) 编辑
摘要: .attr() -> 获取元素的属性,如name就是属性 .prop() -> 获取元素的状态,如checked,selected,disabled 阅读全文
posted @ 2016-01-31 16:04 tu-l 阅读(97) 评论(0) 推荐(0) 编辑
摘要: <div class="test"> <p>A元素</p> <div>B元素</div> <p>C元素</p> <p>D元素</p> </div> 看下面的代码 $("p:nth-of-type(2)")//选择的是C元素 $("p:nth-child(2)")//什么元素也没选中 两者比较: 这里 阅读全文
posted @ 2016-01-30 16:11 tu-l 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 1):parent -> 选择含有子元素(包括文本节点)的父级元素 1):empty -> 选择没有子元素(包括文本节点)的父级元素 :hidden 、:visible -> 如果元素占据文档一定空间,元素被认为是可见的,visibility:hidden或opacity:0被认为是可见的,因为仍占 阅读全文
posted @ 2016-01-30 15:50 tu-l 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 如果把css都放到一个文件中,可能会为后期维护带来一些麻烦,把所有的css分别放在几个文件中是个好主意。建议:1)保存与整体布局有关的样式 ->layout.css 2)专门的颜色样式表 -> color.css3)保存与板式有关的样式 -> typography.css [字体、大小]把这些样式表... 阅读全文
posted @ 2016-01-22 18:16 tu-l 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 1)减少对Dom的操作如:if(document.getElementByTagName("a").length>0){ var links=document.getElementByTagName("a"); ...}查询任意Dom元素,浏览器都是搜索整个Dom树,更好的方法是把第一次搜索的结... 阅读全文
posted @ 2016-01-19 16:33 tu-l 阅读(155) 评论(0) 推荐(0) 编辑