Jquery projection animation and jquery projection Animation
Click here to experience the effect: http://keleyi.com/keleyi/phtml/jqtexiao/26.htm
:
The Code is as follows:
1 <! Doctype html> 2
In the example, the animation effect is implemented using jquery's animate function, see: http://keleyi.com/a/bjac/5b62295315de9ace.htm
The Math. floor is used to take an integer, For details, see: http://keleyi.com/a/bjad/s0ix7ao1.htm
The append method is also used, and the append () method inserts the specified content at the end of the selected element (still inside). For details, see http://keleyi.com/a/bjac/0vpch15n.htm
The removeClass method and addClass method can be referred to: http://keleyi.com/a/bjac/e9e40a974de5a902.htm
Web Front-end resource Summary: http://www.cnblogs.com/jihua/p/webfront.html
Jquery animation Loop
You can create a timer to run every 2 seconds:
$ (Document). ready (function (){
SetTimeout (function () {abc ();}, 2000)
});
Function abc ()
{
. Animate ({top: "-= 20px"}, 2247)
. Animate ({top: "+ = 20px"}, 2247)
. Animate ({left: "-= 20px"}, 2247)
. Animate ({left: "+ = 20px"}, 2247)
}
Jquery Animation
Using the callback function of the animate method, I wrote a piece of code, which is quite dead, but it should be able to achieve the desired effect.
$ (This). find ("img"). animate ({left:-52}, 100, function (){
SetTimeout (function (){
$ (This). find ("img"). animate ({left:-102}, 100, function (){
SetTimeout (function (){
$ (This). find ("img"). animate ({left:-155}, 100, function (){
SetTimeout (function (){
$ (This). find ("img"). animate ({left:-155}, 100 );
},1000 );
});
},1000 );
});
},1000 );
});