⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 809ye1.htm

📁 javascript各种效果的实例及源代码
💻 HTM
字号:
<html>
<head>
<title>页面缩小特效</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
.intro{
position:absolute;
left:0;
top:0;
layer-background-color:white;
background-color:white;
border:0.1px solid white
}
-->
</style>
</head>

<body bgcolor="#000000">
<!---如下代码必须紧接着<body>写!->
<div id="i1" class="intro"></div>
<script language="JavaScript1.2">

//尝试改变速度
var speed=5
if (document.layers){
var reference=window.innerWidth/window.innerHeight
var temp=eval("document.i1.clip")
temp.left=temp.top=0
temp.right=window.innerWidth
temp.bottom=window.innerHeight
}
else if (document.all){
var reference=document.body.clientWidth/document.body.clientHeight
var rightclip,leftclip,topclip,bottomclip
var temp=document.all.i1.style
topclip=leftclip=0
rightclip=temp.width=document.body.clientWidth
bottomclip=temp.height=document.body.clientHeight
}


function doit(){
window.scrollTo(0,0)
if (document.layers){
if (temp.left>window.innerWidth/2)
clearInterval(stopit)
temp.left+=reference*speed
temp.top+=speed
temp.right-=reference*speed
temp.bottom-=speed
}
else if (document.all){
if (leftclip>document.body.clientWidth/2)
clearInterval(stopit)
temp.clip="rect( "+topclip+" "+rightclip+" "+bottomclip+" "+leftclip+")"
leftclip+=reference*speed
topclip+=speed
rightclip-=reference*speed
bottomclip-=speed
}
}
stopit=setInterval("doit()",100)

</script>

<textarea name=source rows=12 cols=55 class=yk9>
脚本说明:
第一步:把如下代码加入<head>区域中:
<style>
<!--
.intro{
position:absolute;
left:0;
top:0;
layer-background-color:white;
background-color:white;
border:0.1px solid white
}
-->
</style>



第二步:把<body>中加入如下代码:
<!---如下代码必须紧接着<body>写!->
<div id="i1" class="intro"></div>
<script language="JavaScript1.2">

//尝试改变速度
var speed=5
if (document.layers){
var reference=window.innerWidth/window.innerHeight
var temp=eval("document.i1.clip")
temp.left=temp.top=0
temp.right=window.innerWidth
temp.bottom=window.innerHeight
}
else if (document.all){
var reference=document.body.clientWidth/document.body.clientHeight
var rightclip,leftclip,topclip,bottomclip
var temp=document.all.i1.style
topclip=leftclip=0
rightclip=temp.width=document.body.clientWidth
bottomclip=temp.height=document.body.clientHeight
}


function doit(){
window.scrollTo(0,0)
if (document.layers){
if (temp.left>window.innerWidth/2)
clearInterval(stopit)
temp.left+=reference*speed
temp.top+=speed
temp.right-=reference*speed
temp.bottom-=speed
}
else if (document.all){
if (leftclip>document.body.clientWidth/2)
clearInterval(stopit)
temp.clip="rect( "+topclip+" "+rightclip+" "+bottomclip+" "+leftclip+")"
leftclip+=reference*speed
topclip+=speed
rightclip-=reference*speed
bottomclip-=speed
}
}
stopit=setInterval("doit()",100)

</script>
</textarea>
<br>
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -