Skip to content

Instantly share code, notes, and snippets.

@mlangens
Created September 2, 2011 20:24
Show Gist options
  • Save mlangens/1189801 to your computer and use it in GitHub Desktop.
Save mlangens/1189801 to your computer and use it in GitHub Desktop.
animate mhmm
<html>
<head>
<title>Event Stuff</title>
<style type="text/css">
body {
overflow: hidden;
}
#image {
position: absolute;
top: 50%;
left: -50%;
}
</style>
</head>
<body>
<img id="image" src="http://i.imgur.com/LUAT1.jpg" />
<input id="irie" type="button" value="shit b shift" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="http://org-dev.theworkdept.com/sites/all/themes/formalrigor/js/transform/dist/jquery.transform.js"></script>
<script type="text/javascript">
(function($) {
results = function() {
percents = [Math.floor(Math.random() * 90 + 10), Math.floor(Math.random() * 90 + 10)];
rotateNeg = Math.floor(Math.random() * 3 + 2)
rotatePos = Math.floor(Math.random() * -3 -2)
$('#image').animate({
origin: [percents[0] + "%" , percents[1] + "%"]
});
function whatever() {
var animationAngle = {};
if(percents[0] < percents[1]) {
animationAngle = { rotate: rotateNeg };
} else {
animationAngle = { rotate: rotatePos };
}
return animationAngle;
}
$('#image').animate(whatever());
};
function returnAFunctionObj() {
console.log('this is executed on page load at ' + Date());
var retFunc = function() {
console.log('hi this is a convoluted example at ' + Date());
};
return retFunc;
}
$('#irie').click(results);
})(jQuery);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment