This article mainly introduces the materials related to the combination of jQueryanimate and CSS3 to achieve the slow-moving chase effect. If you need it, you can refer to CSS3 and jquery to achieve the slow-moving Chase Effect, however, considering the browser compatibility, we recommend that you use the jquery animate method.
The following figure shows the implementation result:
Download demo source code
Reference file: jquery-1.11.1.min.js
Html
Jquery
var $first=$('#first');var $second=$('#second');(function(){move1();move2();})()function move1(){$first.animate({"left":220,"top": 0},400).animate({"left":220,"top":220},400).animate({"left":0,"top":220},400).animate({"left":0,"top":0},function(){move1();})}function move2(){$second.animate({"right":220,"bottom": 0},400).animate({"right":220,"bottom":220},400).animate({"right":0,"bottom":220},400).animate({"right":0,"bottom":0},function(){move2();})}
The above is a small series of jQuery animate and CSS3 combined to achieve the effect of slow-moving Chase, I hope to help you!