以下はプログラムコードです。
次のようにコードコードをコピーします。
<!doctype html />
<html>
<head>
<メタhttp-equiv = "content-type" content = "text /html; charset = gb2312" /> />
<メタhttp-equiv = "x-ua-compatible" content = "ie = emulatie7" />
<title>画像フリップ効果</title>
<style type = "text/css">
.box {Overflow:hidden:relative;}
.txt {100%;
テキストアライグ:センター:アルファ(不透明= 80);
#b1 {url(http://biyuan.tk/u/upload/201310221457326875.jpg);
#b2 {background(http://biyuan.tk/u/upload/201310221457486875.jpg);
#b3 {url(http://biyuan.tk/u/upload/201310221458149843.jpg);
</style>
</head>
<body>
<div id = "obj">
<div id = "b1"> <div>テキスト説明<br/>テキスト説明</br/>テキスト</div> </div>
<div id = "b2"> <div>テキスト説明<br/>テキスト説明</br/>テキスト</div> </div>
<div id = "b3"> <div>テキスト説明<br/>テキスト説明</br/>テキスト</div> </div>
</div>
<script type = "text/javascript">
関数show(o、s、v){{
ClearInterval(show.prototype ["a" + v]);
show.prototype ["a" + v] = setInterval(function(){
if(s == -1){
if(O.Offsettop <= -o.parentnode.offseTheight){{
o.style.top = -o.parentnode.offseTheight + "px";
clearIntervalを返します(show.prototype ["a" + v]);
}
} それ以外 {
if(O.Offsettop> = -10){
o.style.top = 0;
clearIntervalを返します(show.prototype ["a" + v]);
}
}
o.style.top =(o.offsettop * 1 + 10 * s) + "px";
}、10);
}
var igs = document.getElementById( 'obj')。
for(var i = 0; i <igs.length; i ++){
if(igs [i] .classname == "box"){{
(function(x){
igs [x] .onmouseover = function(){
show(this.childnodes [0]、1、x);
this.onmouseout = function(){
show(this.childnodes [0]、-1、x);
}
}
}) (私);
}
}
</script>
</body>
</html>
エフェクトプレビュー:http://biyuan.tk/u/upload/201310221500310000.html