<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>jquery实现的3D翻转效果</title>
<link rel="stylesheet" href="css/base.css" type="text/css" media="screen" />
<script src="http://www.lanrenzhijia.com/ajaxjs/jquery.min.js"></script>
<script src="js/base.js"></script>
<script src="js/rotate3di.js"></script>
<script>
$(document).ready(function () {
$('#nav-list-example li div.back').hide().css('left', 0);
function mySideChange(front) {
if (front) {
$(this).parent().find('div.front').show();
$(this).parent().find('div.back').hide();
} else {
$(this).parent().find('div.front').hide();
$(this).parent().find('div.back').show();
}
}
$('#nav-list-example li').hover(
function () {
$(this).find('div').stop().rotate3Di('flip', 250, {direction: 'clockwise', sideChange: mySideChange});
},
function () {
$(this).find('div').stop().rotate3Di('unflip', 500, {sideChange: mySideChange});
}
);
});
</script>
</head>
<body>
<center>
<ul id="nav-list-example">
<li>
<div class="front">
<h2><a href="#">Apple</a></h2>
</div>
<div class="back">
<p><a href="#">Apples are a round fruit.</a></p>
</div>
</li>
<li>
<div class="front">
<h2><a href="#">Banana</a></h2>
</div>
<div class="back">
<p><a href="#">Bananas are a yellow fruit.</a></p>
</div>
</li>
<li>
<div class="front">
<h2><a href="#">Cherry</a></h2>
</div>
<div class="back">
<p><a href="#">Cherries are a delicious fruit.</a></p>
</div>
</li>
<li>
<div class="front">
<h2><a href="#">Durian</a></h2>
</div>
<div class="back">
<p><a href="#">Durians are a stinky fruit.</a></p>
</div>
</li>
</ul>
</center>
</body>
</html>