Some Problems on WeChat H5 page and h5 page

Source: Internet
Author: User

H5 page problems, h5 page Problems

I made an h5 invitation letter page and forgot to sort it out when I encountered several mobile problems.

1. The cursor in the input box is not centered. If height is set, line-height setting is invalid,

Solution: do not set the height. After setting the Row height with line-height, use padding to raise the height.

2. Add an audio file to the file, but the file will not be played automatically,

Solution:

Function audioAutoPlay (id) {// solves the problem of internal audio playback failure. var audio = document. getElementById (id); audio. play (); document. addEventListener ("WeixinJSBridgeReady", function () {audio. play () ;}, false); document. addEventListener ("YixinJSBridgeReady", function () {audio. play () ;}, false) ;}audioautoplay ("music ");

3. The h5 page does not support JS refresh or redirection.

Var a = Math. random () * 100;
Window. location. href = window. location. href + "? Id = "+;

4. Move the layout up due to the soft keyboard of the Android phone

Solution:

① If a bug occurs in the input box at the bottom, move the button up.

② Corrected through JS

function fixfixed(obj) {          if(document.activeElement.nodeName == 'INPUT'){            obj.css('position', 'static');        } else {            obj.css('position', 'fixed');        }    }

These are currently available. When a new one is encountered, add another

Related Article

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.