• 首页 | Home
  • 日志 | Blog
  • 摘录 | Note
  • 生活 | Life
  • 标签 | Tag
  • 留言 | GBook

RSS订阅

更多订阅方式更多订阅方式
google reader
QQ邮箱
鲜果
抓虾

一些链接

  • Blueidea博客
  • 技术摘录
  • QQ空间
  • Blog

    document.styleSheets

    2010-02-24 21:45:11 | 标签:document.styleSheets
  • document.styleSheets可以获取页面上所有使用<style>或<link rel="stylesheet"> 标签标记的样式。 获取样式片段: IE: document.styleSheets[0].rules[0]  // rules 是第几个选择器; other: document.styleSheets[0].cssRules[0]  // cssRules 是第几条规则   <style type="text/css">   -----------------> 片段1(document.styleSheets[0]) p, div { border: 1px solid #000; } h5 { color:blue; }  </style>  <style type="text/css">    ----------------> 片段2(document.styleSheets[1]) p, div { border: 2px solid #000; } h5 { color:red; }  </style>   注意: rules获取的是第几个选择器;而cssRules获取的是第几条规则; eg:IE: document.styleSheets[0].r
  • Blog

    layout 触发器

    2010-02-24 21:44:33 | 标签:layout
  • IE下的haslayout在有些时候会导致很多问题,今天整理一下,方便以后查看。 默认具有 layout 的元素: <html> <body> <table> <tr> <th> <td> <img> <hr> <input> <select> <textarea> <button> <iframe> <embed> <object> <applet> <marquee> haslayout触发器: position: absolute float: left|right display: inline-block width: 除 “auto” 外的任意值 height: 除 “auto” 外的任意值 zoom: 除 “normal” 外的任意值(MS专有属性,无法通过校验) writing-mode: tb-rl (MS专有属性,无法通过校验) ·IE7独有的layout 触发器: overflow: hidden|scroll|auto overflow-x|-y: hidden|scroll|auto(overflow-x 和 overflow-y 是 CS
  • Blog

    提取一下web默认字体比较重要的几点

    2009-12-17 13:08:04 | 标签:web字体
  • 在IE6和IE7中,行高值必须大于字体的2px才能保证字体的完整显示或当其作为链接时能有效显示下划线。 中文最好用unicode表示,比如使用宋体是{font-family:\5b8b\4f53;},使用微软雅黑是{font-family:\5fae\8f6f\96c5\9ed1;} ,这样的好处是避免编码问题,同时能得到所有的主流浏览器的支持。 Tahoma 普及性还是相当不错的。 从渐进增强角度讲,font-family: Tahoma, Helvetica, Arial, sans-serif; 可以达到优雅降级的目的。在更好的用户代理中,显示更好的字体,同时用 Arial 殿后,也能保证在尽可能多终端设备中正确显示。(注:考虑 Mac 用户,Leopard 中内置了 Tahoma 字体,因此 font-family: Hel
  • Blog

    DOM加载检测

    2009-12-17 13:07:16 | 标签:DOM
  • 对于DOM加载检测,Firefox 3+,Opera 9+,Safari 3+,Chrome 2+均支持DOMContentLoaded事件 document.addEventListener("DOMContentLoaded", init, false); IE一般通过doScroll()函数检测。不推荐script的defer方式,可能存在冲突(Mootools v1.11版本即存在此问题,见http://home.blueidea.com/space.php?uid=513902&do=blog&id=16366)。 小于 Safari 3+ 的 Safari 浏览器,John Resig 提供了一个解决方案: if (/WebKit/i.test(navigator.userAgent)) { // sniff     var _timer = setInterval(function() {         if (/loaded|complete/.test(document.readyState)) {             clearInterval(_timer);             init(); // call the onload handler         }     }, 10); } 由于J
  • Blog

    Mootools v1.11在IE6/8 下domready与innerHTML的冲突

    2009-12-17 13:06:23 | 标签:Mootools
  • Mootools v1.11下的domready函数在IE6/8下,遇到innerHTML时会导致DOM加载判断错误。 解决方案(已更新): if (window.ie){      document.onreadystatechange = function(){          if (document.readyState == "complete") {                document.onreadystatechange = null;          }       };    (function(){         try{              document.documentElement.doScroll('left');         }catch(e){              setTimeout(arguments.callee, 0);              return;         }         alert('DOM Loaded IE');    })(); }else{      window.addEvent('domready', function(){            alert('DOM Loa
  • Blog

    [转]data:urls - what are they and how to use them

    2009-12-17 13:05:52 | 标签:data:urls
  • If you follow this blog you already know the infamous website performance rule #1 - reduce the number of HTTP requests. Actually, to celebrate Earth Day and to jump the "go-green" wagon/jargon, my favourite performance mantra as of late is "Reduce, Reuse, Recycle" (the Recycle part is a wee fuzzy but, oh well) So to reduce the number of requests for JavaScript files, you combine all .js into one monolithic file. Same for .css For images - use CSS sprites to create one image files that contains all your little icons. Yet another way to minimize the number of HTTP requests is to use data URLs (proper name is data URI scheme). "data... uri? urgh-i? An example, please!" Say you have this minuscule image: which you include like: <im
  • Blog

    [转]In Search of the Holy Grail

    2009-12-17 13:05:17 | 标签:Holy Grail
  • 转自:http://www.alistapart.com/articles/holygrail I’m sorry. Really. I didn’t name it. I don’t mean to overstate its importance or trivialize the other and rather weightier Holy Grails. But the name’s out there, and we all know what it means. Three columns. One fixed-width sidebar for your navigation, another for, say, your Google Ads or your Flickr photos—and, as in a fancy truffle, a liquid center for the real substance. Its wide applicability in this golden age of blogging, along with its considerable difficulty, is what has earned the layout the title of Holy Grail. Many articles have been written about the grail, and several good templates exist. However, all the existing solutions involve sacrifices: proper source orde
  • Blog

    收到了Google Wave的邀请

    2009-12-17 13:04:24 | 标签:Google Wave
  • 一大早打开电脑,看看邮件,发现垃圾箱里竟然是Google Wave的邀请。汗,给腾讯放到垃圾箱里去了。。。 Thank you for signing up to give us early feedback on Google Wave. We're happy to give you access to Google Wave and are enlisting your help to improve the product. 郁闷,自己什么时候给Google feedback了。 先看看UI,Wave的UI很清爽,采用了Chrome默认主题的那种蓝色,个人还是很喜欢的。不知道以后可以换主题不? Wave主要分3栏布局,最左边那栏是菜单,第二栏是相应内容列表,最右边就是每一个Wave了。 在一些过渡方面,感觉有些效果不是很流畅,不知道是不是我的电脑问题。
  • Blog

    br 标签的 clear 属性

    2009-12-17 13:03:32 | 标签:br clear
  • 通常情况下, 标签会告诉浏览器立即停止当前的文本流,并在下一行的左边,或者在左对齐的内联图形或表格的右边开始继续输出文本流。 但是有时候,您也许希望当前的文本流在当前左边或右边的内联表格或图像的下面一行继续输出。 HTML 4 和 XHTML 通过 标签提供了这样的功能。它可以具有三个值:left、right 或者 all,每个值都代表一个边界或两边的边界。当指定的边界没有图像时,浏览器才会继续输出文本。 1.不带有 align 属性的 标签与带有 clear 属性的 标签 This text should wrap around the image, flowing between the image and the right margin of the document. This text wi
  • Blog

    FF下实现text-overflow:ellipsis的效果

    2009-12-17 13:02:56 | 标签:FF text-overflow
  • 以下是一些资料 http://www.aoao.org.cn/blog/2008/07/firefox-text-overflow-ellipsis/ http://www.hedgerwow.com/360/dhtml/text_overflow/demo3.php 基本都是通过xul:description来实现的。 一般: p { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } 52CSS上的说明http://www.52css.com/article.asp?id=602
12
  • About JH.L | WAP | XHTML | CSS | Processed in 0.2117s
  • Copyright © 2009 JH.L All Rights Reserved | Powered By JH.L