CSS之照片翻转
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JSphoto翻转</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><!-- 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)+"%";
setOpacity(P2i, 100-.5*(p*p));
if (p == 20) {
P2i.src = IMGSRC[kI].src;
setOpacity(P2i, 100);
P2.style.width = "50%";
for(var i=1; i<=20; i++) setTimeout("TPR__("+i+")", i*32);
}
}
function TPR() {
if (!run) {
run = true;
P01i.src = IMGSRC[kI].src;
P1.style.width = 0;
kI++;
if (kI>=nI) kI = 0;
titLe(kI);
P02i.src = IMGSRC[kI].src;
P1i.src = IMGSRC[kI].src;
for (var i=1; i<=20; i++) setTimeout("TPR_("+i+")", i*32);
} else setTimeout("TPR()", 100);
} function TPL__(p) {
P2.style.width = (2.5*p)+"%";
setOpacity(P2i, .5*p*p);
if (p == 20) run = false;
}
function TPL_(p) {
P1.style.left = (2.5*p)+"%";
P1.style.width = 40+(10-2.5*p)+"%";
setOpacity(P1i, 100-.5*(p*p));
if (p == 20) {
P1i.src = IMGSRC[kI].src;
setOpacity(P1i, 100);
P1.style.left = 0;
P1.style.width = "50%";
for(var i=1; i<=20; i++) setTimeout("TPL__("+i+")", i*32);
}
}
function TPL() {
if (!run) {
run = true;
P02i.src = IMGSRC[kI].src;
P2.style.width = 0;
kI--;
if (kI < 0) kI = nI-1;
titLe(kI);
P01i.src = IMGSRC[kI].src;
P2i.src = IMGSRC[kI].src;
for(var i=1; i<=20; i++) setTimeout("TPL_("+i+")", i*32);
} else setTimeout("TPL()", 100);
}
function titLe(p) {
document.getElementById("TXTBOX").innerHTML = IMGSRC[p].alt;
}
onload = function() {
IMGSRC = document.getElementById("imgsrc").getElementsByTagName("img");
DB = document.getElementById("DHTMLBOOK");
P01 = DB.getElementsByTagName("span")[0];
P01i = P01.getElementsByTagName("img")[0];
P02 = DB.getElementsByTagName("span")[1];
P02i = P02.getElementsByTagName("img")[0];
P1 = DB.getElementsByTagName("span")[2];
P1i = P1.getElementsByTagName("img")[0];
P2 = DB.getElementsByTagName("span")[3];
P2i = P2.getElementsByTagName("img")[0];
nI = IMGSRC.length;
P1i.src = IMGSRC[kI].src;
P2i.src = IMGSRC[kI].src;
titLe(kI);
DB.style.visibility = "visible";
}
//-->
</SCRIPT> <META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY> <DIV id=center>
<DIV id=DHTMLBOOK><SPAN class=page onMouseDown="return false;" ondblclick=TPL(); onclick=TPL();><IMG class=img></SPAN>
<SPAN class="page right" onMouseDown="return false;" ondblclick=TPR(); onclick=TPR();><IMG class=img style="LEFT: -100%"></SPAN>
<SPAN class="page turn" onMouseDown="return false;" ondblclick=TPL(); onclick=TPL();><IMG class=img style="FILTER: alpha(); opacity: 1"></SPAN>
<SPAN class="page turn right" onMouseDown="return false;" ondblclick=TPR(); onclick=TPR();><IMG class=img style="FILTER: alpha(); LEFT: -100%; opacity: 1"></SPAN>
<DIV id=TXTBOX></DIV></DIV></DIV>
<DIV id=imgsrc style="VISIBILITY: hidden">
<IMG alt="" src="http://images.cnblogs.com/cnblogs_com/caidupingblogs/767491/o_13_173919_4.jpg">
<IMG alt="" src="http://images.cnblogs.com/cnblogs_com/caidupingblogs/767491/o_13_173919_4.jpg"> </DIV>
</BODY></HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JSphoto翻转</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><!--
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)+"%";
setOpacity(P2i, 100-.5*(p*p));
if (p == 20) {
P2i.src = IMGSRC[kI].src;
setOpacity(P2i, 100);
P2.style.width = "50%";
for(var i=1; i<=20; i++) setTimeout("TPR__("+i+")", i*32);
}
}
function TPR() {
if (!run) {
run = true;
P01i.src = IMGSRC[kI].src;
P1.style.width = 0;
kI++;
if (kI>=nI) kI = 0;
titLe(kI);
P02i.src = IMGSRC[kI].src;
P1i.src = IMGSRC[kI].src;
for (var i=1; i<=20; i++) setTimeout("TPR_("+i+")", i*32);
} else setTimeout("TPR()", 100);
}
function TPL__(p) {
P2.style.width = (2.5*p)+"%";
setOpacity(P2i, .5*p*p);
if (p == 20) run = false;
}
function TPL_(p) {
P1.style.left = (2.5*p)+"%";
P1.style.width = 40+(10-2.5*p)+"%";
setOpacity(P1i, 100-.5*(p*p));
if (p == 20) {
P1i.src = IMGSRC[kI].src;
setOpacity(P1i, 100);
P1.style.left = 0;
P1.style.width = "50%";
for(var i=1; i<=20; i++) setTimeout("TPL__("+i+")", i*32);
}
}
function TPL() {
if (!run) {
run = true;
P02i.src = IMGSRC[kI].src;
P2.style.width = 0;
kI--;
if (kI < 0) kI = nI-1;
titLe(kI);
P01i.src = IMGSRC[kI].src;
P2i.src = IMGSRC[kI].src;
for(var i=1; i<=20; i++) setTimeout("TPL_("+i+")", i*32);
} else setTimeout("TPL()", 100);
}
function titLe(p) {
document.getElementById("TXTBOX").innerHTML = IMGSRC[p].alt;
}
onload = function() {
IMGSRC = document.getElementById("imgsrc").getElementsByTagName("img");
DB = document.getElementById("DHTMLBOOK");
P01 = DB.getElementsByTagName("span")[0];
P01i = P01.getElementsByTagName("img")[0];
P02 = DB.getElementsByTagName("span")[1];
P02i = P02.getElementsByTagName("img")[0];
P1 = DB.getElementsByTagName("span")[2];
P1i = P1.getElementsByTagName("img")[0];
P2 = DB.getElementsByTagName("span")[3];
P2i = P2.getElementsByTagName("img")[0];
nI = IMGSRC.length;
P1i.src = IMGSRC[kI].src;
P2i.src = IMGSRC[kI].src;
titLe(kI);
DB.style.visibility = "visible";
}
//-->
</SCRIPT>
<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY>
<DIV id=center>
<DIV id=DHTMLBOOK><SPAN class=page onMouseDown="return false;" ondblclick=TPL(); onclick=TPL();><IMG class=img></SPAN>
<SPAN class="page right" onMouseDown="return false;" ondblclick=TPR(); onclick=TPR();><IMG class=img style="LEFT: -100%"></SPAN>
<SPAN class="page turn" onMouseDown="return false;" ondblclick=TPL(); onclick=TPL();><IMG class=img style="FILTER: alpha(); opacity: 1"></SPAN>
<SPAN class="page turn right" onMouseDown="return false;" ondblclick=TPR(); onclick=TPR();><IMG class=img style="FILTER: alpha(); LEFT: -100%; opacity: 1"></SPAN>
<DIV id=TXTBOX></DIV></DIV></DIV>
<DIV id=imgsrc style="VISIBILITY: hidden">
<IMG alt="" src="http://images.cnblogs.com/cnblogs_com/caidupingblogs/767491/o_13_173919_4.jpg">
<IMG alt="" src="http://images.cnblogs.com/cnblogs_com/caidupingblogs/767491/o_13_173919_4.jpg">
</DIV>
</BODY>
CSS之照片翻转的更多相关文章
- HTML和CSS实现图片翻转效果
实现图片翻转,首先来分析一下我们希望实现的是怎样的翻转效果?又该如何去实现呢? 一.希望实现的效果 页面上的图片在光标悬停在上面的时候会发生翻转效果,翻转过后显示出背面的说明文字. 鼠标没有悬停在上面 ...
- CSS实例:翻转图片、滚动图片栏、打开大门
CSS 翻转图片主要用到的技术除了3D翻转和定位 ,还用到了一个属性 backface-visibility:visable|hidden;该属性主要是用来设定元素背面是否可见. 效果图如下: 具体的 ...
- css动画+照片清晰度动画
源代码: <!DOCTYPE html><html><head> <title>donghua</title> <meta chars ...
- CSS 实例之翻转图片
具体效果图如下: 主要用到的技术除了3D翻转和定位 ,还用到了一个新的属性 backface-visibility:visable|hidden; 该属性主要是用来设定元素背面是否可见. 具体的步骤如 ...
- CSS 3D图片翻转 ——3D Flipping Effect
效果: 代码如下: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> < ...
- 分享一下学习css,js心得
简化代码,使页面简洁! web前端开发——将界面更好呈现给用户! 要了解在不同浏览器上的兼容情况.渲染原理和存在的bug! 网站性能优化.SEO: 代码的可维护性.性能: 网站重构的本质:建立一个前端 ...
- CSS3+HTML5特效2 - 翻转效果
先看效果,鼠标移上去看看. back front 1. 本实例需要以下元素 a. 容器BOX b. 默认显示元素FRONT c. 翻转显示元素BACK 2. 容器BOX的Height为200px,Wi ...
- 两个重叠的div做前后翻转
当需要做一个翻转卡片式的div时候,需要两个div的大小等大例如: 画出两个等大的div后,将他们重叠 图中的两个div做了重叠,做重叠时候用的属性是 position: absolute; 并且需要 ...
- webapp填坑记录[更新中]
网上也有许多的 webapp 填坑记录了,这几个月,我在公司正好也做了2个,碰到了一些问题,所以我在这里记录一下我所碰到的问题: meta 头部声明在开发的时候,刚刚创建 HTML 文件,再使用浏览器 ...
随机推荐
- SQLite内存数据库
[转]SQLite内存数据库 http://www.cnblogs.com/liuyong/archive/2010/09/14/1826152.html SQLite 介绍 一. SQLite 是实 ...
- centos 6.5下安装docker
关于docker的更多信息,请移步度娘.以下两个链接也对docker有了具体的介绍: http://www.docker.org.cn/book/docker/what-is-docker-16.ht ...
- MEF 编程指南(五):延迟导出
在组合部件的时候,导入将会触发部件(部件集合)的实例化,为原始的请求部件公开必要的导出需求.对于有些应用程序,推迟实例化 - 并且防止递归组合图(Recursive Composition Down ...
- 【转】Activity启动模式 及 Intent Flags 与 栈 的关联分析
http://blog.csdn.net/vipzjyno1/article/details/25463457 在学习Android的过程中,Intent是我们最常用Android用于进程内或进 ...
- POJ2142——The Balance
刚学习的扩展欧几里得算法,刷个水题 求解 线性不定方程 和 模线性方程 求方程 ax+by=c 或 ax≡c (mod b) 的整数解 1.ax+by=gcd(a,b)的一个整数解: <sp ...
- UVA 1557 - Calendar Game(博弈dp)
UVA 1557 - Calendar Game 题目链接 题意:给定一个日期,两个人轮流走,每次能够走一月或者一天,问最后谁能走到2001.11.4这个日子 思路:记忆化搜索,对于每一个日期,假设下 ...
- C++ AppendMenu
主题 1. 系统菜单下面添加自定义菜单 2. 3. 4. 5. AppendMenu The AppendMenu function appends a new item to th ...
- DOS命令生成文件列表
DOS命令窗口,生成文件列表命令格式:dir xmlFiles /b >list.txt dir 文件列表相关命令 xmlFiles 待生成文件所在文件夹,在dos命令窗口根目录下,省略前缀.别 ...
- Android SDK安装时碰到的问题之解决办法
问题:hostname in certificate didn't match: <dl-ssl.google.com> != <www.google.com> Fetchin ...
- Java语言与C++语言的差异总结
Java的设计者曾说过,设计这门语言的灵感主要来自于C++. 世上先有C++,然后才有Java,整个Java语言的发展历史就是一部对C++的填坑史.所以在Java语言学习过程中,将其与C++语言对比是 ...