The example of this article tells JS to judge the mobile phone and the PC side to choose different execution event methods. Share to everyone for your reference. Specifically as follows:
To determine whether a cell phone:
function IsMobile () {
var suseragent= navigator.userAgent.toLowerCase (),
bisipad= Suseragent.match (/ipad/i) = "ipad",
bisiphoneos= suseragent.match (/iphone os/i) = "iphone
A long time ago I wrote a browser to determine the browser version or phone type through the browser navigator, which describes the use of navigator to determine the browser type. Make a supplement on this article today!
Js judges the indexOf mode of Android or ios
/ / Determine the access terminal
Var browser={
Version: function(){
Var u = navigator.userAgent, app = navigator.appVersion;
Return {
Trident: u.indexOf('Trident') > -1, //IE kernel
Pr
Improve mobile Angular. js applications with Trigger. io
Improve mobile Angular. js applications with Trigger. io
Author: chszs, reprinted with note. Blog homepage: http://blog.csdn.net/chszs
Trigger. io Forge allows us to develop local mobile applications using the latest a
Caching jquery and common styles to localstorage can reduce HTTP requests and optimize page load times, which can be implemented by the following code:
To view write records:
Packaged into JS Plug-ins:
/** * Plug-in function: Use Localstorage cache js and CSS files, reduce HTTP requests and page rendering time, suitable for Web Mobile end H5 pa
}) |d{3,4}-|s)? D{8} Extract the Chinese phone number (including mobile and landline) from the Information:((d{3,4}) |d{3,4} -|s)? D{7,14} Extract information in China postcode: [1-9]{1} (d+) {5} Extract information from China ID: d{18}|d{15} Extract the Integer in the information: d+ extract the floating-point number in the information (that is, decimal): (-?d*).? D+ extract any number in the information: (-?d*) (. d+)? Extract the Chinese string in
|\\|\/|\.)+ (' | ' | *|>)? The IP address in the extracted information: (\d+) \. (\d+) \. (\d+) \. (\d+) Chinese mobile phone number in extracting information: (*0*13\D{9) The Chinese fixed phone number in extracting information: (\ (\d{3,4}\) |\d{3,4}-|\s)? \d{8} Extract the Chinese phone number (including mobile and landline) in the information:(\ (\d{ 3,4}\) |\d{3,4}-|\s)? \d{7,14} Extracting information
JS execution pause, pure speculation), then we need to the countdown to I also have two solutions for this problem:
Use the timer to automatically correct the time intervals;Use the Visibilitychange event to listen for the hidden state of the document, that is, to view the Document.hidden value, false to page display, and true to page hide:
Document.addeventlistener ("Visibilitychange", function (e) {
if (!e.path[0].hidden) {//E.path for the collect
Dragula is an element that supports mobile touch screen devices. Drag and drop the pure JS plugin. This element drag-and-drop plugin is easy to use, browser-compatible, and allows you to drag the DOM elements through your mouse or through your finger in a mobile device. It is characterized by:
Settings are very simple
No external dependencies
The data
Summary of the methods for verifying mobile phone numbers and email addresses using javascript. Although there are many such examples on the Internet, it is always the best to write the code by yourself. The following two examples are prepared by yourself, share with you.
// Function is_mobile (value) {var pattern =/^ 1 [358] [0123456789] \ d {8 }$/; if (! Pattern. test (value) {return false;} return true ;}
// Verify email correctness using javascr
There are several simple ways to fit the mobile and PC side, and I'm using a percentage allocation method.*{padding:0;margin:0;} Body,html{width:100%;height:100%;overflow:hidden;} #bottom_box {width:100%;height:50px;background-color: #eee;d Isplay:flex; This is the flex layout, where the parent element is set to flex, and the child elements set a few equal parts are divided into equal portions position:fixed;bottom:0px;}. tab{flex:1; The child el
This article describes the method of JS to judge the mobile phone number operator. Share to everyone for your reference. Specifically as follows:
When doing a Web project, sometimes need to according to the user's input cell phone number to judge the operator is mobile, unicom, telecommunications or other, and then according to different operators to make corres
For more information, please click here.Online Preview Download NowHow to use: refer to CSS files and JS files respectively such as: HTML: javascript: window.onload=function(){ photoSlide({ wrap: document.getElementById(‘photo‘),//最外层容器 loop: true,//设置无缝循环 autoPlay:true,//自动轮播 autoTime:4000,//轮播时间间隔 pagination:true //点状态列表 }); } Complete Example: Phone preview effect scan QR code:Online Preview Download NowFor more information on HTML5
JQuery Mobile Slider Widget uses js control and jquerywidgetJQuery Mobile slider Control
The basic usage is needless to say. Here:
Http://www.runoob.com/jquerymobile/jquerymobile-form-sliders.html
The creation method is very simple. Four different slide styles are also provided in runnoob.
However, only one effect is missing, that is, the input box next to it i
JS + CSS: simulates the screen-like dial interface and functions of mobile phones, and simulates a complete instance of css dial
This article describes how to simulate the dial interface and function simulation of mobile phones using JS + CSS. Share it with you for your reference. The details are as follows:
First, let
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.