当前位置: 主页->网页特效专栏->浏览相关->页面转换特效
栏目导航
网页特效
  典型特效 状态栏
  游戏类 页面背景
  页面特效 页面导航
  文本操作 文本特效
  图形特效 鼠标特效
  时间日期 密码类
  浏览相关 警告对话
  技巧类 计数转换
  测试搜索 代码生成
  播放音乐 按钮特效
  系统相关 链接特效
  黑客性质 相关特效
  窗口特效 其它特效
最新更新
 
 
 
 
 
 
 
 
 
 
热点文章
 
 
 
 
 
 
 
 
 
 

页面转换特效

夜鹰电脑教学网 加入日期:2005-08-04 21:40:00 点击数:

查看:[大字体 中字体 小字体]

说明: 页面转换特效

效果: 点这里在新窗口中看效果!

代码: 第一步:把如下代码加入<body>区域中


<SCRIPT LANGUAGE="JavaScript">
<!--
// 过渡的速度
var pause=50
var widthstep=10

// 效果的色彩
var curtaincolor1="FFFF00"

// 右
var curtaincolor2="EE8800"

// 下
var curtaincolor3="EE8800"

// 左
var curtaincolor4="FFFF00"

var screenheight
var screenwidth
var heightstep
var maxmove=0
var timer
var url
var curtaincontent1=""
var curtaincontent2=""
var curtaincontent3=""
var curtaincontent4=""

function init() {
if (document.all) {
screenwidth=document.body.clientWidth
screenheight=document.body.clientHeight
curtaincontent1="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor1+"'> </td></tr></table>"
curtaincontent2="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor2+"'> </td></tr></table>"
curtaincontent3="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor3+"'> </td></tr></table>"
curtaincontent4="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor4+"'> </td></tr></table>"
curtain1.innerHTML=curtaincontent1
curtain2.innerHTML=curtaincontent2
curtain3.innerHTML=curtaincontent3
curtain4.innerHTML=curtaincontent4
heightstep=Math.round(widthstep/screenwidth*screenheight)
}
if (document.layers) {
screenwidth=window.innerWidth
screenheight=window.innerHeight
curtaincontent1="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor1+"'>&nbsp;</td></tr></table>"
curtaincontent2="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor2+"'>&nbsp;</td></tr></table>"
curtaincontent3="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor3+"'>&nbsp;</td></tr></table>"
curtaincontent4="<table cellpadding=0 cellspacing=0 width='"+screenwidth+"' height='"+screenheight+"'><tr><td bgcolor='"+curtaincolor4+"'>&nbsp;</td></tr></table>"
document.curtain1.document.write(curtaincontent1)
document.curtain1.document.close()
document.curtain2.document.write(curtaincontent2)
document.curtain2.document.close()
document.curtain3.document.write(curtaincontent3)
document.curtain3.document.close()
document.curtain4.document.write(curtaincontent4)
document.curtain4.document.close()
heightstep=Math.round(widthstep/screenwidth*screenheight)
}
}

function openpage(thisurl) {
url=thisurl
if (document.all) {
document.all.curtain1.style.posTop=-screenheight
document.all.curtain1.style.posLeft=0
document.all.curtain2.style.posTop=0
document.all.curtain2.style.posLeft=screenwidth
document.all.curtain3.style.posTop=screenheight
document.all.curtain3.style.posLeft=0
document.all.curtain4.style.posTop=0
document.all.curtain4.style.posLeft=-screenwidth
document.all.curtain1.style.visibility="VISIBLE"
document.all.curtain2.style.visibility="VISIBLE"
document.all.curtain3.style.visibility="VISIBLE"
document.all.curtain4.style.visibility="VISIBLE"
movecurtains()
}
if (document.layers) {
document.curtain1.top=-screenheight
document.curtain1.left=0
document.curtain2.top=0
document.curtain2.left=screenwidth
document.curtain3.top=screenheight
document.curtain3.left=0
document.curtain4.top=0
document.curtain4.left=-screenwidth
document.curtain1.visibility="VISIBLE"
document.curtain2.visibility="VISIBLE"
document.curtain3.visibility="VISIBLE"
document.curtain4.visibility="VISIBLE"
movecurtains()
}
}

function movecurtains() {
if (maxmove<=screenwidth/2) {
if (document.all) {
document.all.curtain1.style.posTop+=heightstep
document.all.curtain2.style.posLeft-=widthstep
document.all.curtain3.style.posTop-=heightstep
document.all.curtain4.style.posLeft+=widthstep
}
if (document.layers) {
document.curtain1.top+=heightstep
document.curtain2.left-=widthstep
document.curtain3.top-=heightstep
document.curtain4.left+=widthstep
}
maxmove+=widthstep
var timer=setTimeout("movecurtains()",pause)
}
else {
clearTimeout()
document.location.href=url
}
}

// - End of JavaScript - -->
</SCRIPT>

<STYLE>
.curtain {
position:absolute;
visibility:hidden;
}
</STYLE>
<DIV ID="deletethisblock" class="redirstyle" style="position:absolute;left:10px;top:10px;color:000000;font-family:"宋体";font-size:9pt">
<a href="javascript:openpage('http://www.yy0736.com/js/')">看看效果吧!!</a>
</DIV>
<DIV ID="curtain1" class="curtain"></DIV>
<DIV ID="curtain2" class="curtain"></DIV>
<DIV ID="curtain3" class="curtain"></DIV>
<DIV ID="curtain4" class="curtain"></DIV>

第二步:把<body>中的内容改为:


<body bgcolor="#fef4d9" onLoad="init()" style="width:100%;overflow-x:hidden;overflow-y:hidden">

作者:佚名 来源: 网上转帖  

   

上篇:页面下沉抖动效果  下篇:滚动条颜色生成器II IE5.5+


[夜鹰论坛] [我要留言] [关闭窗口] [ ][TOP]

此文章最新评论(不超过十条)
■评论此文章 ( 有问题请去夜鹰论坛发帖 )
共有评论: 查看全部评论 姓名:
【 声明 】 您所发表的言论将被众多网友阅读,因此,您所发表的言论应不违反中国法律,不违背一般的道德原则,否则,您必须对您的不当言论引发的一切不良后果负责;此外,我们的管理员有权删除您发表的不当言论,谢谢合作!