Some problem handling and event description in mobile web

Source: Internet
Author: User
<span id="Label3"></p>1.1.1<strong><strong><span style="font-family: 黑体;">all boxes start with a border</span></strong></strong><p class="18"><p class="18"><em>/*</em> <em><span style="font-family: 微软雅黑;">set the width to start the calculation with a border</span></em> <em>*/</em><em><br></em>-webkit-box-sizing: <strong>Border-box</strong>;<br>Box-sizing: <strong>Border-box</strong>;</p></p><p><p>a <span style="font-family: 宋体;">percentage layout is typically used on the mobile side, so the layout uses</span> border <span style="font-family: 宋体;">or</span> <span style="font-family: Times New Roman;">padding</span> or causes the width of the <span style="font-family: 宋体;">container to exceed the width of the screen to produce Scrollbars. So what's our solution? try</span> the <span style="font-family: Times New Roman;">css3</span> <span style="font-family: 宋体;">Property </span> <span style="font-family: Times New Roman;">box-sizing</span> <span style="font-family: 宋体;">to set all the Box's heavy borders to start calculating the Width. </span></p></p><p><p></p></p>1.1.2<strong><strong>I</strong></strong><strong><strong>nput <span style="font-family: 黑体;">Clear the default style</span> </strong></strong><p class="18"><p class="18">/* <span style="font-family: 微软雅黑;">How to clear the default style on the mobile side</span> */<br>/* <span style="font-family: 微软雅黑;">Clear the default browser style on the mobile side</span> */<br>-webkit-appearance: <strong>None</strong>;</p></p><p><p><span style="font-family: 宋体;">in a mobile device browser, the form will typically have default properties</span> <span style="font-family: 宋体;">by</span> Border<span style="font-family: 宋体;">:</span><span style="font-family: Times New Roman;">None</span></p></p><p><p>Outline<span style="font-family: 宋体;">:</span>None <span style="font-family: 宋体;">is completely clear, or there are some browser default properties, such as:</span></p></p><p><p><span style="font-family: 宋体;">Inner shadow, Stereoscopic 、、、 How do we get rid of the styles that are added to these browsers by default?</span></p></p><p><p><span style="font-family: 宋体;">we have a property</span> -webkit-appearance <span style="font-family: 宋体;">This property refers to the set to</span> none</p></p><p><p></p></p>1.1.3<strong><strong><span style="font-family: 黑体;">limit for minimum width and maximum width</span></strong></strong><p class="18"><p class="18">max-width:640<strong>px</strong>; /* <span style="font-family: 微软雅黑;">in the industry the mobile side of the design is generally used</span> 640px*/</p></p><p class="18"><p class="18"><span style="font-family: 微软雅黑;">If the design is</span> 750px</p></p><p class="18"><p class="18">min-width:300<strong>px</strong>; /* <span style="font-family: 微软雅黑;">the smallest size in the mobile device now</span> 320px*/</p></p><p><p><span style="font-family: 宋体;">applicable: more pictures of home page, portal, E-commerce</span> <span style="font-family: 宋体;">and so On. </span></p></p><p><p><span style="font-family: 宋体;">function</span> Ensure that the page <span style="font-family: 宋体;">in the larger size of the device to ensure that the effect of the page is refreshing</span></p></p><p><p><span style="font-family: 宋体;">ensure that the page in the small size of the device has a better layout effect. </span></p></p><p><p></p></p>1.1.4<strong><strong>I</strong></strong><strong><strong>the <span style="font-family: 黑体;">lower clearance problem of</span> mg</strong></strong><p class="18"><p class="18"><<strong>div</strong>></p></p><p class="18"><p class="18">Abcdefghijklmnopqrstuvwxyz</p></p><p class="18"><p class="18"><<strong>img </strong>src=<strong>". /images/nv-fy.jpg </strong>"alt="<strong>"</strong>/></p></p><p class="18"><p class="18"></<strong>Div</strong>></p></p><p><p></p></p><p><p>The default baseline for <span style="font-family: 宋体;">text baselines</span> starts <span style="font-family: 宋体;">at</span> the bottom of X <span style="font-family: 宋体;">.</span></p></p><p><p>IMG <span style="font-family: 宋体;">is an inline block-level element that also has a default baseline Alignment. Then the same as the text will be a certain gap from the Bottom. </span>font-size 0 <span style="font-family: 宋体;">-aligned Way</span></p></p><p><p></p></p>1.1.5<strong><strong><span style="font-family: 黑体;">Search button Call</span></strong></strong><p class="18"><p class="18"><em><!--</em> <em><span style="font-family: 微软雅黑;">Click the pop-up input method on the mobile</span></em> <em>Enter</em> <em><span style="font-family: 微软雅黑;">Key will display the search</span></em> <em></em> -<em><br></em><<strong>form </strong>action=<strong>"#"</strong>><br><<strong>input </strong>type=<strong>"search" </strong>placeholder=<strong>"</strong> <strong><span style="font-family: 微软雅黑;">tips</span></strong> <strong>"</strong>/><br></<strong>Form</strong>></p></p><p><p></p></p><p><p><span style="font-family: 宋体;">when the mobile side calls the input method will pop up the keypad, the keyboard is generally</span> the Enter <span style="font-family: 宋体;">key, then in the search box we require the call is a search button, then such a structure can be called Out. </span></p></p><p><p></p></p><p><p></p></p><p><p></p></p><p><p></p></p>1.1<strong><strong><span style="font-family: 黑体;">Knowledge Content</span></strong></strong>1.1.1<strong><strong>T</strong></strong><strong><strong>Ouch <span style="font-family: 黑体;">Events</span> </strong></strong><p><p>Touchstart<span style="font-family: 宋体;">:</span> <span style="font-family: 宋体;">triggers when the finger touches the Screen. </span></p></p><p><p><span style="font-family: 宋体;">How to bind an event:</span></p></p><p class="18"><p class="18">Dom.addeventlistener (<strong>' Touchstart '</strong>,<strong>function</strong>(e) {});</p></p><p><p><span style="font-family: 宋体;">the E object returned by the event</span> <span style="font-family: 宋体;">contains properties that are specific to the mobile side:</span></p></p><p><p>Targettouches <span style="font-family: 宋体;">All current touches of the target element</span></p></p><p><p>Changedtouches <span style="font-family: 宋体;">All the latest changes to the touch on the page</span></p></p><p><p>Touches <span style="font-family: 宋体;">all touches on the page</span></p></p><p><p></p></p><p><p>Touchmove<span style="font-family: 宋体;">:</span> <span style="font-family: 宋体;">A continuous trigger when the finger is sliding on the Screen. </span></p></p><p><p><span style="font-family: 宋体;">How to bind an event:</span></p></p><p class="18"><p class="18">Dom.addeventlistener (<strong>' Touch</strong><strong>move</strong><strong>'</strong>,<strong>function</strong>(e) {});</p></p><p><p><span style="font-family: 宋体;">the E object returned by the event</span> <span style="font-family: 宋体;">contains properties that are specific to the mobile side:</span></p></p><p><p>Targettouches <span style="font-family: 宋体;">All current touches of the target element</span></p></p><p><p>Changedtouches <span style="font-family: 宋体;">All the latest changes to the touch on the page</span></p></p><p><p>Touches <span style="font-family: 宋体;">all touches on the page</span></p></p><p><p></p></p><p><p></p></p><p><p>Touchend<span style="font-family: 宋体;">:</span> <span style="font-family: 宋体;">triggered when the finger leaves the screen</span> <span style="font-family: 宋体;">. </span></p></p><p><p><span style="font-family: 宋体;">How to bind an event:</span></p></p><p class="18"><p class="18">Dom.addeventlistener (<strong>' Touch</strong><strong>end</strong><strong>'</strong>,<strong>function</strong>(e) {});</p></p><p><p><span style="font-family: 宋体;">the E object returned by the event</span> <span style="font-family: 宋体;">contains properties that are specific to the mobile side:</span></p></p><p><p>Changedtouches <span style="font-family: 宋体;">All the latest changes to the touch on the page</span></p></p><p><p></p></p><p><p></p></p><p><p>Touchcancel<span style="font-family: 宋体;">:</span> The <span style="font-family: 宋体;">system stops tracking when the touch is Triggered. </span></p></p><p><p><span style="font-family: 宋体;">This event will not be used frequently, understand it.</span></p></p><p><p></p></p><p><p><span style="font-family: 宋体;">note: the</span> <span style="font-family: 宋体;">event</span> <span style="font-family: Times New Roman;"></span> <span style="font-family: 宋体;">will only be logged</span> when Touchend events <span style="font-family: Times New Roman;">changedtouches</span></p></p><p><p>ClientX: <span style="font-family: 宋体;">Touch the X-coordinate of the target in the viewport</span> <span style="font-family: Times New Roman;"></span> <span style="font-family: 宋体;">. </span></p></p><p><p>ClientY: <span style="font-family: 宋体;">Touch the Y-coordinate of the target in the viewport</span> <span style="font-family: Times New Roman;"></span> <span style="font-family: 宋体;">. </span></p></p><p><p>PageX<span style="font-family: 宋体;">: Touch the x-coordinate of the target in the page</span> <span style="font-family: Times New Roman;"></span> <span style="font-family: 宋体;">. </span></p></p><p><p>Pagey<span style="font-family: 宋体;">: Touch the y-coordinate of the target in the page</span> <span style="font-family: Times New Roman;"></span> <span style="font-family: 宋体;">. </span></p></p><p><p>ScreenX: <span style="font-family: 宋体;">Touch the x-coordinate of the target in the screen</span> <span style="font-family: Times New Roman;"></span> <span style="font-family: 宋体;">. </span></p></p><p><p>ScreenY: <span style="font-family: 宋体;">Touch the y-coordinate of the target in the screen</span> <span style="font-family: Times New Roman;"></span> <span style="font-family: 宋体;">. </span></p></p><p><p></p></p>1.1.2<strong><strong><span style="font-family: 黑体;">transition and animation end events</span></strong></strong><p><p></p></p><p><p>Transitionend <span style="font-family: 宋体;">triggers after the transition is Over. </span></p></p><p><p><span style="font-family: 宋体;">How to bind an event:</span></p></p><p class="18"><p class="18">Dom.addeventlistener (<strong>' webkittransitionend '</strong>,<strong>function</strong>(e) {});</p></p><p class="18"><p class="18">Dom.addeventlistener (<strong>'</strong><strong>t</strong><strong>ransitionend '</strong>,<strong>function</strong>(e) {});</p></p><p class="18"><p class="18"></p></p><p><p></p></p><p><p>The Animationend <span style="font-family: 宋体;">animation is triggered after the End. </span></p></p><p><p><span style="font-family: 宋体;">How to bind an event:</span></p></p><p class="18"><p class="18">Dom.addeventlistener (<strong>' WebKit</strong><strong>Animation</strong><strong>End '</strong>,<strong>function</strong>(e) {});</p></p><p class="18"><p class="18">Dom.addeventlistener (<strong>'</strong><strong>animation</strong><strong>End '</strong>,<strong>function</strong>(e) {});</p></p><p><p></p></p><p><p></p></p>1.1.3<strong><strong>G</strong></strong><strong><strong>esture <span style="font-family: 黑体;">Events (not commonly Used)</span> </strong></strong><p><p>Gesturestart</p></p><p><p><span style="font-family: 宋体;">Triggered when a finger touches the screen and the second finger touches the screen again.</span></p></p><p><p>Gesturechange</p></p><p><p><span style="font-family: 宋体;">Triggered immediately after the above event is Triggered.</span></p></p><p><p>Gestureend</p></p><p><p>the <span style="font-family: 宋体;">second finger is triggered when it leaves the screen, and gesturechange will not be triggered again</span> <span style="font-family: 宋体;">. </span></p></p><p><p></p></p><p><p>The <span style="font-family: 宋体;">other two parameters are returned</span> <span style="font-family: 宋体;">in the</span> event</p></p><p><p>Scale <span style="font-family: 宋体;">initial</span> 1 <span style="font-family: 宋体;">based on the sliding distance of two fingers</span></p></p><p><p>Rotation <span style="font-family: 宋体;">rotation angle calculated based on the sliding distance of two fingers</span> <span style="font-family: 宋体;">initial</span> 0</p></p><p><p></p></p>1.1.4<strong><strong><span style="font-family: 黑体;">Full Screen single page layout</span></strong></strong><p><p><span style="font-family: 宋体;">How to try Percentages:</span></p></p><p class="18"><p class="18"><em>/*</em> <em><span style="font-family: 微软雅黑;">Full Screen</span></em> <em>*/</em><em><br></em><strong>HTML</strong>,<strong>body</strong>{<br>height:100%;<br>}</p></p><p><p></p></p><p><p>Some problem handling and event description in mobile web</p></p></span>

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.