Here we have a page to get the verification code to illustrate, as well as a page used in my project. We first create a static page of HTML. Where the code is as follows:
The Salter.js is the JS that we encapsulate. Let's take a look at the effect used: to see our page JS code as follows:
From the above code we see that this encapsulated JS is very
This article describes in detail how js can be used to achieve the scratch effect on PC and mobile terminals. It has some reference value, if you are interested, please refer to this article for details about how js can be used to achieve the scratch effect on PC and mobile terminals. This article has some reference va
Comments: The client APIs on mobile devices and desktops are not synchronized at first. Initially, mobile devices always have certain functions and corresponding APIs first, but slowly, these Apis will appear on the desktop. One of the application interface technologies is the getUserMedia API, which allows application developers to access users' cameras or built-in cameras.
The client APIs on
The client APIs on mobile devices and desktops were not synchronized at first. Initially, mobile devices always have certain functions and corresponding APIs first, but slowly, these Apis will appear on the desktop. One of the application interface technologies is getUserMediaAPI, which allows application developers to access users' cameras or built-in camera mobile
)) {Location.replace (f)}}}} catch (d) {}}function Issubdomain (c, d) {this.getdomain = function (f) {var E = F.indexof ("://"); if (E > 0) {var h = f.substr (E + 3)} else {var h = f} var g =/^www\./; if (G.test (h)) {h = h.substr (4)} return H}; if (c = = d) {return 1} else {var c = This.getdomain (c); var B = This.getdomain (d); if (c = = b) {return 1} else {c = c.replace (".", "\\."); var a = new RegExp ("\ \" + C + "$"); if (B.match (a)) {return 2} else {return 0}}};The above is Baidu
This article introduces the use of JS to determine whether the client is iOS or Android mobile terminals, sample code as follows, interested friends can refer to the next The principle of judgment:nbsp; nbsp; JavaScript is the main language of front-end development, we can write JavaScript programs to determine the type and version of the browser. JavaScript can determine browser types in general there a
JS Common phone number verification (linkage, mobile, telecommunications)Unicom number
function C_liantong (v) {
Return/^0? (?: 13[0-3]|15[1-35-6]|186) D{8}$/.test (v);
}
Mobile number
function C_yidong (v) {
Return/^0? (?: 13[4-9]|15[07-9]|18[789]) d{8}$/.test (v);
}
Phone number of Telecom
function C_dianxin (v) {
Return/^0
Swipe.js is a lightweight mobile content slider, similar to the PC-side slide.js, for implementing carousel ads or other content sliding modules that support mobile screen swipe gesture operations. This library is not dependent on any other JS libraries and can be used independentlyWhen using Swipe.js, simply refer the downloaded file to the page and write the co
JS recognizes the browser type (Computer browsers and mobile browsers). If you don't talk much about it, paste the Code directly. The specific code is as follows:
Recognize computer browsers and mobile browsers
Many websites will have a judgment process to determine whether the browser is a mobile phone, and then jump to the appropriate mobile website! In fact, as long as there is a support for access to JS scripts, we can achieve the same effect.
Function uaredirect (murl) {try {If (document. getelementbyid ("bdmark ")! = NULL) {return;} var urlhash = Window. L
JS Regular expression verification account, mobile phone number, phone, and e-mailEffect Experience: http://keleyi.com/keleyi/phtml/jstexiao/15.htmVerify that your account is legitimateValidation rules: Letters, numbers, underscores, letters beginning with 4-16 digits.function CheckUser (str) { var re =/^[a-za-z]\w{3,15}$/; if (Re.test (str)) { alert ("correct"); } else{ alert ("error
The Blooming-menu is a JS ring menu plugin for use on mobile phones. The Ring menu offers a wide range of parameters to create a very cool round menu with CSS3 animations to unfold and hide the animation effects.Here are the available parameters for this round menu price:
Opts.itemsnum: Type: Number, the parameter is required. This parameter is the number of menu items.
Opts.startangle: Type: n
A recently-made web page needs to display different page styles depending on the user's access to the device, primarily to determine whether a mobile device or a computer browser is accessing it.The following gives the JS judgment processing code, for reference.JS to determine whether the user's browser device is mobile or PC-side
Recently in the mobile site, when you click on the navigation bar, pop-up navigation list, there is a problem. Slide list When the bottom body also follow the scroll, even looking for a toss of the two genius to solve the problem. Here are the main solutions and key codes to share.First, some users suggest that pop-up layer pop-up when the HTML and body are added "height:100%;overflow:hidden;", but there is no egg on the phoneSecond, the combination o
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.