• Double finger scaling and rotation method of mobile terminal based on JS


    JS realizes double finger scaling and rotation at the mobile end, and the specific code is as follows: var initHeading = 0; var rotation = 0; var lastTime; function setGesture(el){ var obj={}; var istouch=false; var start=[]; el.addEventListener(“touchstart”,function(e){ If (e.touches. Length > = 2) {// judge whether there are two points on the screen istouch=true; start=e.touches; […]

  • Using mshta call to run JS or vbs


    Under the command line: Copy codeThe code is as follows: mshta javascript:window.execScript(“msgBox(‘hello youniao’):window.close”,”vbs“);  mshta vbscript:window.execScript(“alert(‘hello youniao’);”,”javascript”)

  • JS to achieve Timer Stopwatch function


    This example for you to share the JS Timer Stopwatch function of the specific code, for your reference, the specific content is as follows HTML <input type=”text” value=”00:00:00″ readonly> < button type = “button” onclick = “start()” > start < / button > < button type = “button” onclick = “stop()” > pause < / […]

  • Strange problems related to JS replace regularization


     Test nickname: Jesse$< View code: JavaScript code Copy codeThe code is as follows: $id(“f_msg_grow_1”).innerHTML=msg[“not_club”][“grow_value”].replace(/\{NICK_NAME}/,this.info[“friend”][“nick_name”]); Looking at the code, you can quickly notice two things: “replace regular” and “$”. In JS, replace supports regular expressions, and $is just a special character of regular backward matching. It’s easy to think of the problem caused by regularity. As […]

  • Implementation of built-in timer based on JS


    Timer has a lot to do with time related projects such as picture carousel and countdown. It is the core syntax to realize these. How to deeply understand JS timer at one time? Look down and you’ll see that there’s a surprise! JS timer has two kinds, one is a single execution after delay, the […]

  • JS to achieve digital scrolling effect


    This example for you to share the JS implementation of digital scrolling display of the specific code, for your reference, the specific content is as follows design sketch HTML code <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <title>Title</title> <style> #t,#tt{ border: #ccc thin solid; width: 250px; height: 60px; display: flex; justify-content: space-around; align-items: center; font-size: […]

  • JS in the Object-Oriented Object common creation method detailed explanation


    This article describes the common creation methods of Object-Oriented Object in JS. The details are as follows: Several common ways to create objects 1. Create an object using object or object literal 2. Creating objects in factory mode 3. Create objects in constructor mode 4. Creating objects in prototype mode 1. Create an object using […]

  • The difference between the top and bottom of script in JS, and the analysis of DOM’s add, delete and create operation


    This article describes the difference between the up and down placement of script in JS and the operation of adding, deleting, modifying and creating dom. The details are as follows: review JavaScript is divided into three parts 1. Ecmascript5.0 ES6 (Ruan Yifeng) ES7 es8     There is the concept of class in ES6 Declare variable […]

  • JS DOM event common operation examples


    This article describes the common operations of JS DOM event. The details are as follows: 1、 Composition of JavaScript JavaScript foundation is divided into three parts ECMAScript: Syntax Standard for JavaScript. Including variables, expressions, operators, functions, if statements, for statements and so on. DOM: document object model, API for manipulating elements on Web pages. For […]

  • Several methods of using JS to operate CSS dynamically


    JavaScript can be said to be the king of interaction. As a scripting language and many web APIs, it further expands its feature set and enriches the operability of interface interaction. Examples of such APIs include the webgl API, the canvas API, the DOM API, and a little-known set of CSS APIs. Because of the […]

  • JS data type conversion and process control operation example analysis


    This paper describes the JS data type conversion and process control operation. The details are as follows: Data type conversion: //Number to str // var str=a+”; // console.log(str); // console.log(typeof str); // It’s converted to a string var str2=a.toString(); // Cast to string console.log(typeof str2); //STR to number var stringNum=’789′; var num2=Number(stringNum); console.log(num2); console.log(typeof num2); […]

  • JS code instance of accurately judging data type


    This article mainly introduces the JS accurate judgment of data type code example, the article through the example code is very detailed, for everyone’s study or work has a certain reference learning value, need friends can refer to There are various shortcomings in the common way of judgment, but the type of is not clear […]