Jquery projection animation and jquery projection Animation

Source: Internet
Author: User

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 );
});

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.