js实现页面窗口的抖动,跟QQ很像哦,大家动手试一下,很简单,就几句代码
<!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=utf-8" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
for(var i=0;i<200;i++){
//向右抖20
moveBy(20,0);
//向下抖20
moveBy(0,20);
//向左抖20
moveBy(-20,0);
//想上抖20
moveBy(0,-20);
}
</script>
</head>
<body>
</body>
</html>
<!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=utf-8" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
for(var i=0;i<200;i++){
//向右抖20
moveBy(20,0);
//向下抖20
moveBy(0,20);
//向左抖20
moveBy(-20,0);
//想上抖20
moveBy(0,-20);
}
</script>
</head>
<body>
</body>
</html>
本文介绍如何利用JavaScript编写几行代码,模仿QQ窗口的抖动效果,包括向右、向下、向左、向上各抖动20像素的操作。
1016

被折叠的 条评论
为什么被折叠?



