原创设计 · PhotoShop · AI/CD · Fireworks · AutoCAD · 3DMAX · Flash · 网页教学 · 高精图库 · 笔刷滤镜 · 矢量素材 · 图片素材 · 模板素材 · 会员相册
加入VIP,下载精美素材 · 原创设计欣赏第七期· QQ空间代码 · QQ空间代码 · QQ空间站· 非主流图片 · QQ头像 · 繁体字非主流图片 · QQ个性签名 · QQ空间播放器

2009年最新设计图书素材低价热销
设计优秀作品第九期/新手学习贴
加入VIP,即送3000缘分币,每月500
 下载素材,加入VIP,享受更多权限
发新话题
打印

[代码] 用链接控制页面小窗口的打开和关闭

用链接控制页面小窗口的打开和关闭

网页特效:用链接控制页面小窗口的打开和关闭
复制内容到剪贴板
代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>show</title>
<style type="text/css">
#show{
display:none;
margin:0px auto;
background-color:#FF0000;
}
#txt{
width:760px;
height:30px;
margin:0px auto;
background-color:#efefef;
}
</style>
</head>
<body>
<div id=show>
</div>
<div id=txt>
<a href="#" onClick="show()">Open</a> <a href="#" onClick="show2()">Close</a>
</div>
<script type="text/javascript">
function show(){
if (!document.getElementById) return false;
if (!document.getElementById("show")) return false;
var show = document.getElementById("show");
show.style.width = "0px";
show.style.height = "0px";
show.style.display = "block";
movement = setTimeout("animation()",0)
}
function animation(){
if (!document.getElementById) return false;
if (!document.getElementById("show")) return false;
var show = document.getElementById("show");
var xpos = parseInt(show.style.width);
var ypos = parseInt(show.style.height);
if (xpos == 760 && ypos == 420){
return true;
}
if (xpos < 760){
xpos++;
}
if (xpos > 760){
xpos--;
}
if (ypos < 420){
ypos++;
}
if (ypos > 420){
ypos--;
}
show.style.width = xpos + "px";
show.style.height = ypos + "px";
movement = setTimeout("animation()",0);
}
function show2(){
if (!document.getElementById) return false;
if (!document.getElementById("show")) return false;
var show = document.getElementById("show");
show.style.width = "760px";
show.style.height = "420px";
show.style.display = "block";
movement = setTimeout("animation2()",0)
}
function animation2(){
if (!document.getElementById) return false;
if (!document.getElementById("show")) return false;
var show = document.getElementById("show");
var xpos = parseInt(show.style.width);
var ypos = parseInt(show.style.height);
if (xpos == 0 && ypos == 0){
return true;
}
if (xpos < 0){
xpos++;
}
if (xpos > 0){
xpos--;
}
if (ypos < 0){
ypos++;
}
if (ypos > 0){
ypos--;
}
show.style.width = xpos + "px";
show.style.height = ypos + "px";
movement = setTimeout("animation2()",0);
}
</script>
</body>
</html>




加入论坛VIP,下尽您想要的素材,点击进入!

如果您在做图或者看教程(PHOTOSHOP方面),遇到任何问题请到问题交流区提问,地址:http://www.missyuan.com/forum-41-1.html;我们会在第一时间帮助您解决问题,如果在教程后面跟帖,一律不给予解决!~


TOP

发新话题



关于本站 广告服务 联系我们 版权隐私 合作站点 网站地图 免责申明 管理团队

Powered by Discuz!6.0.0 Copyright © 2008 www.missyuan.com All rights reserved.