Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

80 lines (69 sloc) 2.143 kB
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.wrap {
float: left;
width: 150px;
height: 150px;
background-color: #eeeeee;
margin: 25px;
}
.transform, .animate {
width: 130px;
height: 130px;
padding: 10px;
background-color: deeppink;
}
.ie {
}
</style>
</head>
<body>
<div class="wrap">
<div class="animate">Transform This<br />Matrix</div>
</div>
<div class="wrap">
<div class="animate">Transform This<br />Straight</div>
</div>
<div class="wrap">
<div class="animate">Transform This<br />Decomposed</div>
</div>
<br clear="all" />
<div class="wrap">
<div class="transform">Transform This<br />Matrix</div>
</div>
<div class="wrap">
<div class="transform">Transform This<br />Straight</div>
</div>
<div class="wrap">
<div class="transform">Transform This<br />Decomposed</div>
</div>
<script type="text/javascript" src="js/jquery-1.4.3.js"></script>
<script src="../src/jquery.transform.js"></script>
<script src="../src/jquery.transform.attributes.js"></script>
<script src="../src/jquery.transform.animate.js"></script>
<script src="../src/jquery.angle.js"></script>
<script src="../src/jquery.matrix.js"></script>
<script src="../src/jquery.matrix.calculations.js"></script>
<script src="../src/jquery.matrix.functions.js"></script>
<script type="text/javascript">
var $anim = $('.animate');
var $elem = $('.transform');
var o = {};
var t = 'translateY';
o[t] = '10px';
var m = $.matrix[t](parseFloat(o[t]));
var d = m.decompose();
var v = [m.e(1, 1), m.e(2, 1), m.e(1, 2), m.e(2, 2), m.e(1, 3), m.e(2, 3)];
$anim.eq(0).animate({matrix: v}, 1000);
$anim.eq(1).animate($.extend({}, o), 1000);
$anim.eq(2).animate($.extend({}, d), 1000);
$elem.eq(0).css({matrix: v});
$elem.eq(1).css($.extend({}, o));
$elem.eq(2).css($.extend({}, d));
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.