日期:2014-05-17 浏览次数:20502 次
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JS实现图片翻书效果</title>
<META http-equiv=imagetoolbar content=no>
<STYLE type=text/css>
#center {
LEFT: 50%; POSITION: absolute; TOP: 50%
}
#DHTMLBOOK {
BACKGROUND: #000; LEFT: -210px; VISIBILITY: hidden; WIDTH: 420px; POSITION: relative; TOP: -160px; HEIGHT: 320px
}
#TXTBOX {
FONT-SIZE: 0.8em; WIDTH: 410px; COLOR: #aba193; FONT-FAMILY: verdana; POSITION: absolute; TOP: 320px; TEXT-ALIGN: center
}
.page {
OVERFLOW: hidden; BORDER-LEFT: #000000 1px solid; WIDTH: 50%; CURSOR: pointer; POSITION: absolute; HEIGHT: 100%
}
.right {
BORDER-RIGHT: #000000 1px solid; LEFT: 50%
}
.turn {
BACKGROUND: #000000
}
.img {
WIDTH: 200%; POSITION: absolute; HEIGHT: 100%
}
</STYLE>
<script type=text/javascript src="scripts/jquery-1.3.2-vsdoc2.js">
document.onselectstart = function () { return false; }
var nI = 0;
var kI = 0;
var run = false;
function setOpacity(obj, o) {
if (o < 0) o = 0; else if (o > 100) o = 100;
if (obj.filters) obj.filters.alpha.opacity = o; else obj.style.opacity = o / 100;
}
function TPR__(p) {
P1.style.left = 50 - (2.5 * p) + "%";
P1.style.width = (2.5 * p) + "%";
setOpacity(P1i, .5 * p * p);
if (p == 20) run = false;
}
function TPR_(p) {
P2.style.width = 50 - (2.5 * p) + "%";