js写网页闪屏震动
来源:互联网 发布:淘宝邮箱格式怎么写的 编辑:程序博客网 时间:2024/06/05 05:44
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
*
{
font-size:12px;
font-family:@楷体,Arial;
font-weight:normal;
color:#333;
}/*规定了所有的字体样式*/
textarea
{
width:100%;
height:98%;
border:1px solid black;
}/*定义了多行文本的样式*/
</style>
<script type="text/javascript">
function resizeWindow() {
var windowWidth = 240, windowHeight = 180;
window.moveTo((screen.availHeight - windowHeight) / 2);
window.resizeTo(windowWidth, windowHeight);
}
function shakeWin(stepId) {
var stepId;
if (!stepId) stepId = 0;
switch (stepId) {
case 0:
window.moveBy(-5, -5);
break;
case 1:
window.moveBy(10, 0);
break;
case 2:
window.moveBy(-10, -10);
break;
case 3:
window.moveBy(10, 0);
break;
case 4:
window.moveBy(-5, -5);
break;
default:
return;
}
stepId++;
setTimeout("shakeWin(" + stepId + ");", 20);
}
function $(str) {
document.getElementById(str);
}
window.onload = resizeWindow;
</script>
</head>
<body style="overflow:auto">
<input type="button" value="点击查看震动闪屏效果" onclick="shakeWin();" />
</body>
</html>
<head>
<title></title>
<style type="text/css">
*
{
font-size:12px;
font-family:@楷体,Arial;
font-weight:normal;
color:#333;
}/*规定了所有的字体样式*/
textarea
{
width:100%;
height:98%;
border:1px solid black;
}/*定义了多行文本的样式*/
</style>
<script type="text/javascript">
function resizeWindow() {
var windowWidth = 240, windowHeight = 180;
window.moveTo((screen.availHeight - windowHeight) / 2);
window.resizeTo(windowWidth, windowHeight);
}
function shakeWin(stepId) {
var stepId;
if (!stepId) stepId = 0;
switch (stepId) {
case 0:
window.moveBy(-5, -5);
break;
case 1:
window.moveBy(10, 0);
break;
case 2:
window.moveBy(-10, -10);
break;
case 3:
window.moveBy(10, 0);
break;
case 4:
window.moveBy(-5, -5);
break;
default:
return;
}
stepId++;
setTimeout("shakeWin(" + stepId + ");", 20);
}
function $(str) {
document.getElementById(str);
}
window.onload = resizeWindow;
</script>
</head>
<body style="overflow:auto">
<input type="button" value="点击查看震动闪屏效果" onclick="shakeWin();" />
</body>
</html>
- js写网页闪屏震动
- js中的写网页跳转
- 仿 msn 闪屏震动
- 原生js写网页下拉菜单
- 原生js写网页版五子棋
- 使用JS让手机震动
- js窗口震动小程序
- js实现微信摇一摇以及震动
- android触屏震动以及震动强度
- 网页中震动屏幕的实现
- html5 navigator 手机震动,js实现手机震动
- 震动
- 震动
- 震动
- 震动
- 震动
- 原生js写的贪吃蛇网页版游戏
- Delphi制作类似QQ的闪屏震动效果
- 通过Runnable接口实现线程机制
- C#位运算处理权限问题介绍
- JS对img进行操作
- Tomcat与Jetty插件 配置根路径指定项目
- Unable to checkout a viewer license
- js写网页闪屏震动
- C. Learning Languages
- SimpleDatabase
- 判断最小生成树的唯一性
- POJ 1006 Biorhythms 数论-(孙子定理)
- 谷歌向欧盟让步承诺微调搜索界面
- PHP程序员测试题及答案
- ACM题目分类
- 清除String乱码