国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

圖片翻轉效果具體實現代碼

2024-05-06 15:58:39
字體:
來源:轉載
供稿:網友
想必大家對圖片翻轉效果都有所了解吧,其實很容易實現的,下面有個不錯的示例,喜歡的朋友可以參考下

以下為程序代碼:

復制代碼 代碼如下:


<!DOCTYPE html />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>圖片翻轉效果</title>
<style type="text/css">
.box {overflow:hidden;position:relative;}
.txt {width:100%;height:100%;background:#f51146;font-size:12px;position:absolute;top:-100%;color:white;
text-align:center;filter:alpha(Opacity=80);-moz-opacity:0.8;opacity:0.8;}
#b1 {background:url();width:232px;height:232px;}
#b2 {background:url();width:110px;height:110px;}
#b3 {background:url();width:110px;height:110px;}
</style>
</head>
<body>
<div>
<div><div>文字說明<br />文字說明</br />文字</div></div>
<div><div>文字說明<br />文字說明</br />文字</div></div>
<div><div>文字說明<br />文字說明</br />文字</div></div>
</div>
<script type="text/javascript">
function 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";
return clearInterval(Show.prototype["a" + v]);
}
} else {
if(o.offsetTop >= -10) {
o.style.top = 0;
return clearInterval(Show.prototype["a" + v]);
}
}
o.style.top = (o.offsetTop * 1 + 10 * s) + "px";
}, 10);
}
var igs = document.getElementById('obj').getElementsByTagName("div");
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);
}
}
})(i);
}
}
</script>
</body>
</html>


效果預覽:
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 赤壁市| 曲阳县| 景东| 横峰县| 永兴县| 昭觉县| 济南市| 东至县| 内丘县| 济阳县| 通江县| 微山县| 永定县| 白玉县| 汽车| 松阳县| 罗源县| 西贡区| 武强县| 江陵县| 清苑县| 扎赉特旗| 长岛县| 莱西市| 正阳县| 瑞金市| 樟树市| 东光县| 若羌县| 巨鹿县| 沿河| 松原市| 旅游| 北辰区| 新建县| 土默特左旗| 湘阴县| 苗栗县| 清镇市| 上栗县| 沂源县|