各浏览器的默认CSS

作者:AilinTao 发布时间:July 29, 2010 分类:默认分类 No Comments

在丸子主编的帮助下终于找到了各浏览器的默认CSS。只要是由于今天解决了一个特殊的问题,依靠的就是看各浏览器的默认CSS,然后重置它,所以很多时候浏览器的默认css还是很有用的。

各浏览器的默认CSS可以在这里http://www.iecss.com/找到,贪心一下,把这些样式都保存了一份:

1. IE6(下载)
2. IE7(下载)
3. IE8(下载)
4. IE9(下载)
5. Firefox 3.6.3(下载)
6. Webkit (r57042) (下载)
7. Opera 10.51(下载)
via: http://www.css88.com/archives/2418

select value

作者:AilinTao 发布时间:June 27, 2010 分类:默认分类 No Comments

// 当没有设定 value 时,标准浏览器 option.value === option.text
// ie7- 下,没有设定 value 时,option.value === '', 需要用 el.attributes.value 来判断是否有设定 value
if(nodeNameIs('option', el)) {
return (el.attributes.value || {}).specified ? el.value : el.text;
}

// 对于 select, 特别是 multiple type, 存在很严重的兼容性问题
if(nodeNameIs('select', el)) {
var index = el.selectedIndex,
options = el.options;

if (index < 0) {
return null;
}
else if(el.type === 'select-one') {
return DOM.val(options[index]);
}

// Loop through all the selected options
var ret = [], i = 0, len = options.length;
for (; i < len; ++i) {
if (options[i].selected) {
ret.push(DOM.val(options[i]));
}
}
// Multi-Selects return an array
return ret;
}

via: http://kissy.googlecode.com/svn/trunk/src/dom/dom.js

getAttribute Method

作者:AilinTao 发布时间:June 27, 2010 分类:默认分类 No Comments

Retrieves the value of the specified attribute.

Syntax

Copy

vAttrValue = object.getAttribute(sAttrName [, iFlags])

Parameters

sAttrName Required. String that specifies the name of the attribute.
iFlags Optional. Integer that specifies one or more of the following flags:

0
Default. Performs a property search that is not case-sensitive, and returns an interpolated value if the property is found.
1
Performs a case-sensitive property search. To find a match, the uppercase and lowercase letters in sAttrName must exactly match those in the attribute name.
2
Returns attribute value as a String. This flag does not work for event properties.
4
Returns attribute value as a fully expanded URL. Only works for URL attributes.

Return Value

Variant that returns a String, Integer, or Boolean value as defined by the attribute. If the attribute is not present, this method returns null.
via: http://msdn.microsoft.com/en-us/library/ms536429%28v=VS.85%29.aspx

  1. 1