<!DOCTYPE html>
<html>
<head>
<meta charset=
"UTF-8"
>
<title></title>
<style>
.box{
width: 322px;
position: fixed;
bottom:0;
right:0;
}
span{
position: absolute;
top:0;
right:0;
width:30px;
height: 20px;
cursor: pointer;
}
.box img{
vertical-align: top;
}
</style>
<script type=
"text/javascript"
src=
"函数封装.js"
></script>
<script type=
"text/javascript"
>
function
$(id){
return
document.getElementById(id);
}
window.onload =
function
(){
var
span = document.getElementsByTagName(
'span'
)[0];
var
box = $(
'box'
);
var
bottom = $(
'bt'
);
var
top = $(
'hd'
);
span.onclick =
function
(){
var
json = {
"height"
: 0};
animate(bottom,json,20,
function
(){
animate(box,{
"width"
:0},20);
});
}
}
</script>
</head>
<body>
<div id=
"box"
>
<span></span>
<div id=
"hd"
>
<img src=
"images/t.jpg"
alt=
""
/>
</div>
<div id=
"bt"
>
<img src=
"images/b.jpg"
alt=
""
/>
</div>
</div>
</body>
</html>