JavaScript CSS Style属性对照表
from: http://sailinglee.javaeye.com/blog/423701
为了达到某种特殊的效果我们须要用Javascript动态的去修改某一个标签的Css属性。比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样:
Javascript代码代码
<script type="text/javascript">
function imageOver(e) {
e.style.border="1px solid red";
}
function imageOut(e) {
e.style.borderWidth=0;
}
</script>
<img src="http://www.knowsky.com/http://www.knowsky.com/phplamp.gif" onmouseover="imageOver(this)" onmouseout="imageOut(this)" />
<script type="text/javascript">
function imageOver(e) {
e.style.border="1px solid red";
}
function imageOut(e) {
e.style.borderWidth=0;
}
</script>
<img src="http://www.knowsky.com/http://www.knowsky.com/phplamp.gif" onmouseover="imageOver(this)" onmouseout="imageOut(this)" />
JavaScript中style后面的属性应该是什么?
JavaScript CSS Style属性对照表
盒子标签和属性对照
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
border
border
border-bottom
borderBottom
border-bottom-color
borderBottomColor
border-bottom-style
borderBottomStyle
border-bottom-width
borderBottomWidth
border-color
borderColo
相关文档:
function isTrueName(s) { var patrn=/^[a-zA-Z]{1,30}$/; if (!patrn.exec(s)) return false return true } }} //校验密码:只能输入6-20个字母、数字、下划线
function isPasswd(s)
{
var patrn=/^(\w){6,20}$/;
if (!patrn.exec(s)) return false
return true
}
//校验普通电话、传真号码:可以 ......
在编写构造函数时,可以使用原型对象(它本身是所有构造函数的一个属性)的属性来创建继承属性和共享方法。原型属性和方法将按引用复制给类中的每个对象,因此它们都具有相同的值。可以在一个对象中更改原型属性的值,新的值将覆盖默认值,但仅在该实例中有效。属于这个类的其他对象不受此更改的影响。下面给出了使用自定义 ......
null, undefined
相同:
当一个变量的值是null, undefined时,表示:我们声明并定义了一个变量,仅仅是这个变量的值是null, undefined.
被调用者:
将null, undefined作为参数传入"JavaScript内置函数"时,不会出现异常,内置函数返回:null -> null, undefined->undefined
但typeof函数除外。
调 ......
页面自动刷新代码大全,基本上所有要求自动刷新页面的代码都有,大家可以自由发挥做出完美的页面。
1)
10表示间隔10秒刷新一次
2)
<script>
window.location.reload(true);
</script>
如果是你要刷新某一个iframe就把window给换成frame的名字或ID号
3)
<script>
window.navigate("本页面url"); ......
源程序:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScript字符串中的字符数组&l ......