_javascript techniques for native JS imitation jquery animate animation effect

Source: Internet
Author: User

jquery Animate animation effect:

Code

<! DOCTYPE html>  

Pay attention.
1. Before the animation to stop the original timer, otherwise binding multiple objects will conflict
2. The ID of the timer to distinguish between, can not overlap, where I directly to the binding object of the object to assign the value Obj.timer
3. To determine whether the animation to be performed, all to the set value => flag, all finished and then stop the timer and then execute the callback function
4.javascript Data Type Conversion issues
alert (0.07*100);
Pop Up 7.000000000000001
Note: JavaScript does not differentiate between number and float types while storing, but rather unifies the float storage. While JavaScript stores number in a 64bit floating-point format defined by the IEEE 754-2008 standard, as defined by IEEE 754:
Decimal64 the corresponding section length is 10, the decimal part length is 16, so the default result is "7.0000000000000001", if the last decimal is 0, then 1 is used as a valid digit mark.
5. The incoming JSON data cannot be PX, such as {' width ': ' 300px '}, in order to be compatible with the transparency of the value, did not think of good treatment, there is no great God under the guidance of ...
6. The timer did a buffer processing, changing more and more slowly, want a quick effect or uniform effect, only to be in 2. Calculate speed that piece of work can be done
7. Incompatible CSS3 properties, only compatible (width,height,top,left,right,bottom,opacity)
8. Get the object style information, to judge IE or Firefox browser, the difference between the treatment

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.