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