📄 8-1 模拟live messenger的振动闪屏.htm
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title>8-1 模拟Live Messenger的振动闪屏</title>
<!-- 样式表 -->
<style>
* { font-size:12px; font-family:宋体, Arial; font-weight:normal; color:#333; } /*规定了所有的字体样式*/
textarea { width:100%; height:98%; border:1px solid black; } /*定义多行文本框的样式*/
</style>
<!-- 脚本部分 -->
<script>
function resizeWindow(){
var windowWidth = 240, windowHeight = 180;
window.moveTo((screen.availWidth - windowWidth)/2,(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){ return(document.getElementById(str)); }
window.onload = resizeWindow;
</script>
</head>
<body style="overflow:auto;">
<input type="button" value="点击查看振动闪屏效果" onclick="shakeWin();" />
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -