<script src="http://www.google.com/jsapi"></script>
<script>
// Load jQuery
google.load("jquery", "1.2.6");
</script>
<script>
$().ready(function() {
$("#my_region_id").css("position", "relative");
$("#my_control_region_id input").click(function(e){
e.preventDefault();
var btn_id = $(this).attr("id");
if (btn_id == 'btnShake') {
$("#my_region_id").animate({"left": "100px"}, "fast")
.animate({"left": "0px"}, "fast")
.animate({"left": "100px"}, "fast")
.animate({"left": "0px"}, "fast")
.animate({"left": "100px"}, "fast")
.animate({"left": "0px"}, "fast");
}
else if (btn_id == 'btnMoveDownUp') {
$("#my_region_id").animate({"top": "250px"}, "fast")
.animate({"top": "0px"}, "slow")
.animate({"top": "250px"}, "fast")
.animate({"top": "0px"}, "slow");
}
else if (btn_id == 'btnMoveAround') {
$("#my_region_id").animate({"top": "250px","left": "250px"}, "fast")
.animate({"left": "0px"}, "fast")
.animate({"top": "0px"}, "slow")
}
});
});
</script> |