<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
/*<![CDATA[*/
#img {
position:absolute;overflow:hidden;left:200px;top:100px;width:200px;height:150px;background-Color:#FFFFCC;border:solid red 1px;
}
#img2 {
position:absolute;left:500px;top:100px;width:200px;height:150px;background-Color:#FFFFCC;border:solid red 1px;
}
.card {
position:absolute;left:0px;top:0px;width:200px;height:150px;border-Width:0px;
}
.div{
overflow:hidden;background-Color:red;float:left;text-Align:center;
}
/*]]>*/
</style></head>
<body>
<div id="img" >
<div class="card div" ><div class="card div" >Some Text Some Text Some Text Some Text</div></div>
<img class="card" src="http://www.vicsjavascripts.org.uk/StdImages/Egypt6.jpg" />
<img class="card" src="http://www.vicsjavascripts.org.uk/StdImages/Blank.gif" />
</div>
<div id="img2" >
<img class="card" src="http://www.vicsjavascripts.org.uk/StdImages/Egypt6.jpg" />
<div class="card div" ><div class="card div" >Some Text Some Text Some Text Some Text</div></div>
</div>
<script type="text/javascript">
/*<![CDATA[*/
function zxcFlip(o){
var oop=this,mde=o.Mode,mde=typeof(mde)=='string'&&mde.charAt(0).toUpperCase()=='V'?['top','height','offsetTop','offsetHeight']:['left','width','offsetLeft','offsetWidth'],obj=document.getElementById(o.ID),imgs=obj.childNodes,ms=o.FlipDuration,sz=obj[mde[3]],ary=[],z0=0
for (;z0<imgs.length;z0++){
if (imgs[z0].nodeType==1){
ary.push(imgs[z0].nodeName.toUpperCase()!='A'?imgs[z0]:imgs[z0].getElementsByTagName('*')[0]);
}
}
ary[0].style[mde[1]]='0px';
ary[0].style[mde[0]]=sz/2+'px';
oop.mde=mde;
oop.sz=sz;
oop.ary=ary;
oop.ms=typeof(ms)=='number'?ms/2:500;
obj.onmouseover=function(){ oop.flip(1); }
obj.onmouseout=function(){ oop.flip(0); }
}
zxcFlip.prototype={
flip:function(nu){
var oop=this,mde=oop.mde,ary=oop.ary,sz=oop.sz,max=Math.max(ary[0][mde[3]],ary[1][mde[3]]),ms=oop.ms*max/sz;
clearTimeout(oop.to1);
clearTimeout(oop.to2);
oop.to1=setTimeout(function(){
oop.animate(mde[1],ary,nu,ary[nu][mde[3]],0,new Date(),ms,'to1');
oop.animate(mde[0],ary,nu,ary[nu][mde[2]],sz/2,new Date(),ms,'to2',true);
},nu==1?50:200);
},
animate:function(mde,ary,nu,f,t,srt,mS,to,ud){
var oop=this,ms=new Date().getTime()-srt,now=(t-f)/mS*ms+f;
if (isFinite(now)){
ary[nu].style[mde]=Math.max(now,0)+'px';
}
if (ms<mS){
oop[to]=setTimeout(function(){ oop.animate(mde,ary,nu,f,t,srt,mS,to,ud); },10);
}
else {
ary[nu].style[mde]=t+'px';
if (ud){
nu=nu==0?1:0;
mde=oop.mde;
this.animate(mde[1],ary,nu,ary[nu][mde[3]],oop.sz,new Date(),mS);
this.animate(mde[0],ary,nu,ary[nu][mde[2]],0,new Date(),mS);
}
}
}
}
new zxcFlip({
ID:'img', // the unique ID name of the parent node. (string)
Mode:'horizontal', //(optional) mode of execution, 'horizontal' or 'vertical'. (number, default = 'horizontal')
FlipDuration:200 //(optional) the flip duration in milli seconds. (number, default = 1000)
});
new zxcFlip({
ID:'img2',
Mode:'vertical'
});
/*]]>*/
</script>
</body>
</html>