1.文字逐渐打出(打字机效果)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Charlie是我们E1的头!</title>
</head>
<body>
<br><br>
<div style="color:red;font-size:50px" id='div1'></div>
<script type="text/javascript">
var count=0;
var typingtext="Charlie是我们E1的头!<br><br>顶Charlie<br>要顶Charlie<br>必须顶Charlie<br>不得不顶Charlie<br>用尽全力顶Charlie<br>再加上千斤顶Charlie<br>总之把它顶到顶Charlie<br>接着使出葵花宝顶Charlie<br>就算顶到史前也要顶Charlie<br>老子看了会用道德经顶Charlie<br>孔子亲自拜你为师天天顶Charlie<br>秦始皇站在阿房宫上使劲顶Charlie<br>汉高祖挥师杀向东罗马为你顶Charlie<br>吕布抛弃了貂蝉而选择了为你顶Charlie<br>张三丰见了用太极拳九全式全力顶Charlie<br>左冷禅召开武林盟主大会商讨如何顶Charlie<br>西门吹雪从此学会了最强一招剑神一顶Charlie<br>龙剑飞的如来神掌最后一式改为万佛朝顶Charlie<br>陆小凤从此现也不管闲事了而专门来为你顶Charlie<br>四大名捕四面出击看天下还有没有人敢不再项Charlie<br>唐僧师徒不去西天取经专程回来召集纵僧为你顶Charlie<br>瑞星杀毒软件从此不杀木马了节约资源只为帮你顶Charlie";
var myBlock=document.getElementById('div1');
function type(){
if(count<=typingtext.length){
myBlock.innerHTML=typingtext.substring(0,count);
count++;
}else{
window.clearInterval(intervalID);
}
}
var intervalID=window.setInterval(type,10);
</script>
</body>
</html>
2.把图片设置为背景
<body background="back.jpg"
style="background-repeat:no-repeat ;
background-size:100% 100%;
background-attachment: fixed;" >
关于背景的设置:详细示例
- 背景颜色属性(background-color)
- 背景图片属性(background-image)
- 背景重复属性(background-repeat)
- 背景附着属性(background-attachment)
- 背景位置属性(background-position)
3.动态交互
javascript进阶
css3相关学习:信封效果实例