开发者

"Driving" into place effect using javascript / jquery

开发者 https://www.devze.com 2023-03-27 06:08 出处:网络
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.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号