使用javascript / jquery“驾驶”到位效果

时间:2011-08-10 14:12:43

标签: javascript jquery google-maps animation

我有一个带有几种状态标记的谷歌地图。标记是卡车,我想设置一个卡车“驱动”在页面加载之前的效果,然后安装到位。

如何使用jQuery实现这种效果?

2 个答案:

答案 0 :(得分:1)

以下是一个很好的例子:http://econym.org.uk/gmap/example_cartrip.htm

您的问题与此How to animate a custom Google Maps marker along a route?重复 希望这有帮助

答案 1 :(得分:1)

$(function(){
    $('.truck').each(function(i){
        var _this = $(this);
        setTimeout(function(){
            _this.animate({
                left: '300px',
                top: i * 150 + 'px'
            },'easeOutQuint');
        },500 * i);
    });
});

工作演示:http://jsfiddle.net/AlienWebguy/taaxQ/