// if the box is outside the window, move it to the end
function checkEdge() {
var windowsLeftEdge = $('#window').position().left;
$('.box').each( function(i, box) {
// right edge of the sliding box
var boxRightEdge = $(box).position().left + $(box).width();
// position of last box + width + 10px
var newPosition = getNewPosition();
if ( parseFloat(boxRightEdge) < parseFloat(windowsLeftEdge) ) {
$(box).css('left', newPosition);
$(box).remove().appendTo('#window');
first = $('.box:first').attr('class');
}
});
}? //Uncaught SyntaxError: Unexpected token ILLEGAL Occurs Here
// arrange the boxes to be aligned …Run Code Online (Sandbox Code Playgroud) 我想在谷歌地图上反弹一次.以下代码将使标记反弹,但它只是继续......
myPin.setAnimation(google.maps.Animation.BOUNCE);
Run Code Online (Sandbox Code Playgroud)
然后打电话
myPin.setAnimation(null);
Run Code Online (Sandbox Code Playgroud)
使动画停止.设置超时有效,但跳出的持续时间看起来不像是一个圆数,所以这样做
setTimeout(function(){ myPin.setAnimation(null); }, 1000);
Run Code Online (Sandbox Code Playgroud)
使弹跳动画过早结束并且看起来很糟糕.
有谁知道更好的方法来实现这一目标?