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

executable file 97 lines (87 sloc) 2.7 kB
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=9" >
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js"></script>
<script src="qTransform.js"></script>
<meta charset=utf-8 />
<title>CSS3 Transform Prototype</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }
body { height: 800px; width: 800px; border: 1px solid red;}
#myDiv {
background-color: #FF0;
position: absolute;
padding: -80px;
width: 100px;
height: 100px;
border: 1px solid green;
hasLayout: true;
zoom: 1;
}
scaleMe {
-webkit-transform: scaleX(2);
-moz-transform: scaleX(2);
-o-transform: scaleX(2);
-ms-transform: scaleX(2);
transform: scaleX(2);
}
translateMe {
-webkit-transform: translate(200px, 200px);
-moz-transform: translate(200px, 200px);
-o-transform: translate(200px, 200px);
-ms-transform: translate(200px, 200px);
transform: translate(200px, 200px);
}
originMe {
-webkit-transform-origin: 100% 100%;
-moz-transform-origin: 100% 100%;
-o-transform-origin: 100% 100%;
-ms-transform-origin: 100% 100%;
transform-origin: 100% 100%;
}
#hold { border: 1px solid gray;}
</style>
</head>
<body>
<div id="hold">
<div id="myDiv"></div>
</div>
<div id="console"></div>
</body>
<script>
var log = function(string) {
$('#console').html(string);
}
log('center rotate');
$('#myDiv')
.css('translate', 100)
.css('rotate', -1)
.css({transformOriginX:'100%', transformOriginY:'100%'})
.css('transformOrigin', '0%,0%')
.delay(1000)
.animate({rotate: 0.28}, 900, function(){log('bottom right rotate')})
.delay(1000)
.animate({transformOriginX:'100%', transformOriginY:'100%'}, 10)
.animate({rotate: 2}, 3000, function(){log('translate')})
.animate({transformOriginX:'50%', transformOriginY:'50%'}, 1000)
.delay(1000)
.animate({translate: 200}, 1000, 'swing')
.animate({translateY: 0}, 1000)
.animate({translateX: 100}, 1000, function(){log('scale')})
.delay(1000)
.animate({scaleY: 0.3}, 2000)
.animate({scaleX: 0.1}, 2000)
.animate({scale: 1}, 500, 'swing')
.animate({rotate: -0.785}, 2000, 'swing')
.animate({scale: 1}, 500, 'swing', function(){log('add rotation and swing origin')})
.animate({rotate: '+=90deg', transformOriginX:'0%', transformOriginY:'0%'}, 3000, 'swing')
.delay(300)
.animate({rotate: '0deg', translateX: '300px', translateY:'300px'}, 2000 )
</script>
</html>
Jump to Line
Something went wrong with that request. Please try again.