Not long ago, to do the mobile side of the demand, mobile is really a lot of pits, below I recorded the problem I encountered:
1, the height of the full screen needs to add the following style:
html{height:100%;};
2, official website Zepto.js The default does not support the animate function, needs to have the choice to add the plug-in, the URL is as follows:
http://github.e-sites.nl/zeptobuilder/
3, Zepto.js does not support scrolltop (return to the top of the smooth effect), you need to write down the JS effect:
Method one of the following code:
functionScroll (selector, animate, Viewoffset) {$ (' body '). Scrolltobottom (0, ' 200 '); } $('. Go_top '). Click (function(e) {e.preventdefault (); Scroll ($ (' #wrap '),true, 30 ); }); $.fn.scrolltobottom=function(scrollheight, duration) {var$el = This; varel = $el [0]; varStartPosition =El.scrolltop; varDelta = scrollheight-startposition; varStartTime =Date.now (); functionScroll () {varfraction = Math.min (1, (Date.now ()-startTime)/duration); El.scrolltop= Delta * fraction +startposition; if(Fraction < 1) {setTimeout (scroll,10); }} scroll (); };
Method Two follows the code:
functionScroll (scrollTo, time) {varScrollfrom =parseint (DOCUMENT.BODY.SCROLLTOP), I= 0, Runevery= 5;//Run every 5msScrollTo =parseint (ScrollTo); time/= Runevery;varInterval = SetInterval (function() {i++; Document.body.scrollTop= (Scrollto-scrollfrom)/time * i +Scrollfrom; if(I >=Time ) {clearinterval (interval); }}, Runevery); } $('. Go_top '). Click (function() {Scroll (' 0 ', 200); });
Return to the top button to hide the display code:
$ (window). Scroll (function() { if(window). scrolltop () >100) { $ ( ". Go_top"). Removeclass ("none"); } Else { $ (". Go_top"). AddClass ("none"); } })
4, <input type= "text"/> text box input text does not wrap, to realize the line-wrapping effect can be replaced with Div, the code is as follows:
<div class= "fl evalute_txt" contenteditable= "true"></div>
5, if only a few columns of the situation, you can use the Display:-webkit-box attribute, if the column width of each row is not the same, resulting in ataxia.
These are some of the most impressive questions that will be added later.
Mobile End Page Summary