I am trying to recreate the effect of map scaling by animating sequentially multiple images with multiple images using jQuery for cross-domain purposes.
I have achieved something so far by queuing up animations using delays and two single animations (logs A and B) for each image to generate smooth transitions between images using scaling and fade them over the next one.
$('img:not(:last-child)') .reverse() .each(function (index) { $(this).css( { 'width': 584, 'height': 336, 'margin-left': -292, 'margin-top': -168 }); $(this).delay(index * 300).animate( { 'width': 1168, 'height': 673, 'margin-left': -584, 'margin-top': -336 }, { duration: 300, easing: 'linear', done: function () { console.log('A:', index, new Date().getTime() - timestamp); } }); }); $('img:not(:first-child)') .reverse() .each(function (index) { $(this).animate( { 'width': 2336, 'height': 1346, 'margin-left': -1168, 'margin-top': -673, 'opacity': 0 }, { duration: 300, easing: 'linear', done: function () { console.log('B:', index, new Date().getTime() - timestamp); $(this).remove(); } }); });
It is well known in jQuery that there is no support for queue animation for different DOM elements in the same queue, which leads to this difficult decision.
Please check the box .
As you will see, as soon as the images are fully loaded and you click on the map, the animation queue will begin. But this is far from ideal. Transitions are not fluid at all , which causes a slight pause between animations, which destroys the result. I tried everything for hours, playing with timeouts, revising the algorithm, forcing linear transitions, but without result.
My main goal is to create the current animation and then recreate the global attenuation effect , for example, "swing" for the entire animation, accelerating as medium-sized images are animated.