标签:
1.文本省略号
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(function () { function sucstr(name,num,a){ var clientw = $(document.body).width(); var pur_span_text = $(name).text(); if(clientw<375){ pur_span_text = pur_span_text.substr(0,num)+‘...‘; } else if(clientw>=375&&clientw<=410){ num=num+a; pur_span_text = pur_span_text.substr(0,num)+‘...‘; } else if(clientw>=410&&clientw<=500){ num=num+a+a; pur_span_text = pur_span_text.substr(0,num)+‘...‘; } else{ } $(name).text(pur_span_text); } sucstr(‘.weui_media_title‘,12,3); }); </script> <div class="weui_media_title"> 123232142412 </div> </body> </html>
2.文本居中
3.禁用UC浏览器左右滑动切换页面
//禁用uc浏览器左右滑动切换页面问题 (function(){ var control = navigator.control || {}; if(control.gesture){ control.gesture(false); } })();
标签:
原文地址:http://www.cnblogs.com/gyz418/p/5810142.html