Month: March 2013
How to fix position absolute z-index bug in IE7
正常的我们做下拉菜单 和 幻灯片重叠在一起的时候,使用 z-index 就可以解决问题,正常的效果应该是这样: 但是天杀的 IE7 却是这样: 这时候任凭你怎么使用 position 和 z-index 都不会起作用! 可以到google搜索 ie7 position absolute z-index 一大堆解决方案。经常我几番研究,下面示范一个通俗易懂的解决方法: 先看一下我的代码结构: 这两个层的 z-index 的值大设置并没有多大关系,只要按照显示在上面的数字越大就可以了。 下面我们找到 mega menu 的根层 #header,给她家上两个css属性 {position: relative;z-index: 10;} 在找到 幻灯片 所在层的根层 #page ,加上 css 属性 {position: relative;z-index: 1;} 保存,测试,看看是不是在IE7 里也正常了。 无聊的可以拿下面的代码中各个浏览器里面试试,定能发现其中的奥妙,至于这是IE7 的什么bug,那就不管了~ <style><!– .parent{width:200px; height:200px; padding:10px;} .sub{text-align:right; font:15px Verdana;width:100px; height:100px;} .lt50{left:50px;top:50px;} –></style> <div…
为WordPress[gallery]短标签里的图片链接添加更多属性
Add rel Attribute to Image Links in WordPress Galleries 如果你想给[ gallery ] 里的图片链接加上而外的属性, rel 或者 class 等等,去配合使用 fancybox、 lightbox 等 jQuery 插件。代码如下: If you want to use either Fancybox or Lightbox scripts for image galleries, you need to add the rel attribute to all full size image links. Here is how to do it: add_filter(‘wp_get_attachment_link’, ‘add_gallery_id_rel’); function add_gallery_id_rel($link) { global $post; return…
PHP多维数组根据内部元素排序
PHP multi array sort by an element nested inside 倘若让数组根据[data]元素的大小重新排序: $data = array( array( ‘name’=>’Julie’, ‘key’=>’64489c85dc2fe0787b85cd87214b3810’, ‘age’=>20 ), array( ‘name’=>’Martin’, ‘key’=>’bb07c989b57c25fd7e53395c3e118185’, ‘age’=>18 ), array( ‘name’=>’Lucy’, ‘key’=>’ab3aec6d954571c7551a186ea1cd98ff’, ‘age’=>100 ), array( ‘name’=>’Jessica’, ‘age’=>25, ‘key’=>’e1a118c9178aa3538f39a9c8131938ed’ ), ); 使用 usort 重排 class itcArraySort { private $arr = array(); public function __construct($arr) { $this->arr = $arr; } public function doSort($key,$order=’ASC’)…