Skip to content

Instantly share code, notes, and snippets.

@EhevuTov
Created March 14, 2012 05:40
Show Gist options
  • Save EhevuTov/2034356 to your computer and use it in GitHub Desktop.
Save EhevuTov/2034356 to your computer and use it in GitHub Desktop.
Jquery Dual Animation
<!DOCTYPE html>
<html>
<head>
<style>
div {
background-color:#bca;
width:100px;
border:1px solid green;
}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<button id="go">&raquo; Run</button>
<div id="block1">Hello1!</div>
<div id="block2">Hello2!</div>
<script>
/* Using multiple unit types within one animation. */
$("#go").click(function(){
$("#block1, #block2").animate({
width: "70%",
opacity: 0.4,
marginLeft: "0.6in",
fontSize: "3em",
borderWidth: "10px"
}, 1500 );
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment