用CSS+JavaScript实现文字闪烁效果
1. CSS
<style>
.dstyle1 {
font-size:13px;
font-weight: bold;
color: #ff6600;
}
.dstyle2 {
font-size:13px;
font-weight: bold;
color: #ffffff;
}
</style>
2. JavaScript
<script type="text/javascript">
m();
function m()
{
document.getElementById("span_new").className="dstyle1";
setTimeout("e()",400);
}
function e()
{
document.getElementById("span_new").className="dstyle2";
setTimeout("m()",300);
}
<script>
相关文档:
① JavaScript添加位置,添加位置错误,会引起JavaScript代码无法执行的问题。
<head runat="server">
<script type='text/javascript' language="javascript">
<!—
//“添加内容”
//-->
</script>
</head>
② 引用他处的脚本 ......
javascript:void(0)
刚开始都不知道是啥意思
其实就是一个死链接,什么事情都不做。
<a id="link_${user.account}" href="javascript:void(0);" onclick="changSubmit();" style="cursor:pointer;height:25px;width:60px;margin-top:10px;">发送email</a>
这句 ......
表单的客户端javascript验证有各种各样的写法,登录为form的onsubmit事件或submit按扭写一个函数。对于小表单(只有一两个表单域的表单)就不必再专门再用javascript写一个验证函数了,只需要在form的onsubmit事件里加上:
onsubmit=”return domainname.value==”?(alert(’请输入搜索内容’),false ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>vForm表单验证程 ......
匹配中文字符的正则表达式: [u4e00-u9fa5]
评注:匹配中文还真是个头疼的事,有了这个表达式就好办了
匹配双字节字符(包括汉字在内):[^x00-xff]
评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)
匹配空白行的正则表达式:ns*r
评注:可以用来删除空白行
匹配HTML标记的正则表达式:< (S ......