Skip to content

Instantly share code, notes, and snippets.

@stla
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stla/81e9a4c253f62aad4011 to your computer and use it in GitHub Desktop.
Save stla/81e9a4c253f62aad4011 to your computer and use it in GitHub Desktop.
Emilie JS
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script>
<script>
$(document).ready(function()
{
var root_pieces = 2;
var tof1 = "https://scontent-a-fra.xx.fbcdn.net/hphotos-xpf1/t31.0-8/p720x720/10257563_10203712186026447_8333802748053406590_o.jpg"
$("#box").attr("src", tof1);
var tof2 = "https://scontent-a-cdg.xx.fbcdn.net/hphotos-xap1/t1.0-9/1619107_10202932800022284_1175209191_n.jpg";
$( "#box" ).mouseover(function() {
$( this ).effect('shake');
});
$("#btn1").click(function(){
$("#box").animate({width:"200px"}
// {progress:function(){
// $( "#box" ).mouseover(function() {
// $( this ).effect('shake');
//}}}
);
$("#box").animate({height:"auto"});
$("#box").animate({width:"300px"});
$("#box").animate({width:"200px"});
});
$("#btn2").click(function(){
$("#box").animate({width:"500px"});
$("#box").animate({height:"auto"});
});
$("#btn3").click(function(){
var pieces=root_pieces*root_pieces;
root_pieces++;
$("#box").toggle('explode', {pieces:pieces}, 1000);
$("#box").show('explode', {pieces:pieces}, 1000);
});
$("#btn_transform").click(function(){
$("#box").toggle('explode', {pieces:16}, 1000);
if ($("#box").attr("src")==tof1) {
$("#box").attr("src", tof2);
}
else {
$("#box").attr("src", tof1);
}
$("#box").show('explode', {pieces:16}, 1000);
});
$("#btn_shake").click(function(){
$("#box").effect('shake');
});
});
</script>
</head>
<body>
<button id="btn1">Animate</button>
<button id="btn3">Explode</button>
<button id="btn_transform">Transform</button>
<button id="btn_shake">Shake</button>
<button id="btn2">Reset</button>
<br>
<p><img id="box" src="" width="500px" align="right"/></p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment