H5 front end animate and other JS special effects issues Summary

Source: Internet
Author: User
Tags button type

Animate in 1.jq do not repeat a large amount of use, can lead to memory overflow or leakage, very intuitive phenomenon is that the phone is too hot;

Remove the default style and change the color for the button type of 2.input:

-webkit-appearance:none;

Background-color:rgb ();

Border:none;

border-radius:5px;

3.js Monitor Touch events:

document.getElementById ("ID"). AddEventListener (  "Touchstart  ", function () {alert (1);});

The top can only be an ID, which is invalid with class

JQ monitoring:

$ ("#id"). On ("touchstart", Function () {      alert ( 1 );      });

4.input type= ' Tel ' or number can eject the numeric keypad

The 5.js eval () function executes the JS code, which can be used to convert a string to an object of the same name:

var New Audio (""); var " AA "+"a"; var audioobj =// can play normally

6. Note: The iOS system has restricted the audio video files in the Web page cannot be played automatically and must be played once after the user interacts (Android no problem)

For 7.Audio objects:

Played: Obj.play ();

Suspension: Obj.pause ();

Replay: obj.currenttime () = 0; Obj.play ();

    

H5 front end animate and other JS special effects issues Summary

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.