I have a google map with markers on several states. The markers are 开发者_如何学JAVAtrucks, and I'd like to setup an effect of the trucks "driving" in on page load before settling into place.
How can I achieve this affect with jQuery?
$(function(){
$('.truck').each(function(i){
var _this = $(this);
setTimeout(function(){
_this.animate({
left: '300px',
top: i * 150 + 'px'
},'easeOutQuint');
},500 * i);
});
});
Working demo: http://jsfiddle.net/AlienWebguy/taaxQ/
Here's a good example: http://econym.org.uk/gmap/example_cartrip.htm
your question is a duplicate of this How to animate a custom Google Maps marker along a route? hope this helps
精彩评论