jQuery(document).ready(function($) { var myLatlng = new google.maps.LatLng('40.6082379','-73.9795245'); var myZoom = 16; var marker; var map; function initialize() { var mapOptions = { zoom: myZoom, mapTypeId: google.maps.MapTypeId.ROADMAP, scrollwheel: false, center: myLatlng }; map = new google.maps.Map(document.getElementById("map-canvas"),mapOptions); marker = new google.maps.Marker({ map:map, animation: google.maps.Animation.DROP, position: myLatlng }); google.maps.event.addDomListener(window, "resize", function() { map.setCenter(myLatlng); }); google.maps.event.addListener(marker, "click", toggleBounce); } function toggleBounce() { if (marker.getAnimation() != null) { marker.setAnimation(null); } else { marker.setAnimation(google.maps.Animation.BOUNCE); } } google.maps.event.addDomListener(window, "load", initialize); });