Website mobile version Development Pit record three

Source: Internet
Author: User

Website mobile version Development Pit record three

In view of my mobile WAP development experience is few, there are a lot of problems, many of the problems are for the project emergency on-line and forced to write temporary fixed scheme, so the solution is also flawed, this record although there is nothing tall on the thing, a few obvious problems and the process of settlement record down.

1, iOS system browser event will trigger two times

The problem was found on the ipad, on the iphone, and initially encountered this problem because I thought I was binding two events (Touchstart click), but because the latest ipad is not supported for the Click event and to prevent duplicate binding events, So I deliberately handled the Touchstart and click to do a unified processing, after watching the event binding I think I triggered two times, and then my tracking code discovery did trigger two times, Google: Click event Call twice in ipad Found that there is a similar situation, http://stackoverflow.com/questions/4569869/jquery-click-event-is-called-twice-on-ipad; Look at the process is unbind and then in bind so each time the click Related events to do this processing, regardless of efficiency, simple repeated binding is not very accustomed. Then I looked for the Fastclick plug-in, probably looked at the source code, through touch.identifier = = = This.lasttouchidentifier Last touch identity to determine whether it is a duplicate call (I am not so advanced, Never noticed before). At first I wanted to solve our problem in this way, and said that we used Zepto on WAP, and if introducing Fastclick meant that clicking on the relevant event bindings was going to be fastclick related, and dom selection and operation would need to zepto two sets, so I decided to give up. Was forced to helpless I think of a way is Dom lock, that is, DOM click Trigger lock dom, so dom 1s does not call repeatedly, so the second touchend will not trigger the business code.

2. Input, select, A and other elements under the mask layer of the Android platform can be clicked and focus

The problem is found in Samsung phones, which are only available under certain requirements, so if there are no similar problems, you can not look at them. The first requirement is the floating layer operation, and the elements that are masked on Samsung can still get focus, click, change. This problem is really tricky ah, don't remember how to check, and finally found https://code.google.com/p/android/issues/ detail?id=6721, it is understood that 3.0 of the following will be affected, in my test on the millet phone will not appear this problem. After looking at the bug report list, two solutions were found, first by adding the corresponding class name control through the layer display, and the second by adding the disabled attribute to the focusable element, so I used the second option because I prefer JS to control them. Of course, due to the ups and downs not only with the focusable elements and a This type of link and a simulation button, all the elements in the non-disabled control will be added to the permanent lock, Then the floating layer is hidden or closed after the lock is unlocked (actually only I tube this through the data property to determine whether to trigger the DOM business code Lock), and then the lucky test passed.

3, the Android platform to get the cursor input when scrolling up and down on the fixed element

The problem is still found in the Samsung comes with the browser, the focus of input through the scroll up and down when the input focus on the fixed layer, this really makes me depressed, Samsung not only in the horizontal screen when I am all kinds of distress, there are a lot of disgusting things, Finding a solution on the internet is that input takes the focus and removes the fixed, so I yy before the event code, and when the page input gets the focus, the fixed layer becomes static. Then the page scrolls to determine whether the docuemnt.activeelement is input or select elements such as inputs and selections, if you continue to remove the fixed, not restore fixed. Then restore the fixed after these elements blur (seemingly scroll seems meaningless AH)

4. Problem with height calculation when switching from one input box to the input box of another mask layer on ipad

Only found on the ipad, not on the iphone, this I only see the effect, there is no corresponding test specific code

5, with the browser to get the window height and operational height inconsistency problem

The demand is to pop the search layer when calculating the window height dynamic control can display area and slide processing, the problem originates from the site embedded in the future, through the browser to open the site, $ (window). Height () Gets a higher altitude than the actual operational height (there is a shell on it, there is an operable menu on the shell), Although the test code is not deployed to the actual test, the urgent project progress is urged, only through the agent to judge is from, will actually get the height minus 100

6, select-option of the show behavior

If you hide an element, the intuitive first thought must be element{dislay:none}; Well, the display looks less effective on the Select option, considering that the content in the dropdown box is displayed on a WAP based on certain conditions, I applied the display naturally, in the simulator test no problem, and then I was particularly relieved to put in the test version. A glance on the phone, I wipe unexpectedly no hidden. See here is a solution: Http://stackoverflow.com/questions/9234830/how-to-hide-a-option-in-a-select-menu-with-css. Although I don't have a pro test, there's no problem with option Display:none in Chrome.

7, the iOS Platform to Screen page disorder problem

The problem is found on the ipad, when the page is rotated repeatedly, the adaptive page appears to be disorganized, such as

Very strange is when the keyboard is not adjusted when the page rotation is normal, only the keyboard and then rotated when the chaos, regardless of whether or not to adjust the keyboard, according to my analysis must be rotated after the re-painting there is a problem, so find a solution, http://stackoverflow.com/ Questions/8840580/force-dom-redraw-refresh-on-chrome-mac is basically the time to redraw the rotation trigger, and then hide.show to reach the page area redraw (although setting to 0 doesn't seem to pass).

8. Safari history on ipad back page layout clutter

This problem occurs on safari (the iOS platform will appear), the data submitted HTML changes or the page generated animation behavior, as for other browsers I have not tested, the problem is due to fall back to the previous step in the use of the HTML cache, recorded the jump to the next page of HTML, So back back to the page after the page of Confusion (forget), so this can only be a big move, if the page is determined by fallback to force refresh the page, how to deal with here http://stackoverflow.com/questions/8788802/ prevent-safari-loading-from-cache-when-back-button-is-clicked ., fill in a document for FF https://developer.mozilla.org/ En-us/docs/using_firefox_1.5_caching

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.