简体   繁体   English

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

[英]“Driving” into place effect using javascript / jquery

I have a google map with markers on several states.我有一个谷歌 map,在几个州都有标记。 The markers are trucks, 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?如何使用 jQuery 实现这种效果?

Here's a good example: http://econym.org.uk/gmap/example_cartrip.htm这是一个很好的例子: 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?您的问题与此如何沿路线为自定义 Google 地图标记设置动画? hope this helps希望这可以帮助

$(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/工作演示: http://jsfiddle.net/AlienWebguy/taaxQ/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM