JavaScript-day17 ----- > > today's main content is that the mouse follows in the box; The width and height of the box; Mouse track; magnifier

1. Review of knowledge points Parent element: parent node Get style # getComputedStyle # ele Currentstyle (IE compatible) The difference between className # and classList className is a string and classList is an array className: sets or returns the class attribute of an element. It returns a string. If I want to delete or add and r ...

Added by Betty_S on Sun, 02 Jan 2022 13:34:43 +0200

Event Loop event loop

First, you need to understand what is Event Loop? Event Loop is an operating mechanism of computer system. JavaScript uses this mechanism to solve some problems caused by single thread operation. 1. Why is JavaScript single threaded? The single thread of JavaScript is related to its purpose. As a browser scripting language, JavaScript is ma ...

Added by Far Cry on Sun, 02 Jan 2022 09:42:45 +0200

jQuery-01: basic syntax operation

1. Entry function Portal on official website: https://jquery.com/jQuery file download: https://code.jquery.com/jquery-1.12.4.min.jsOfficial document portal: http://jquery.cuishifeng.cn/index.html Js native entry function: window.onload = function(){ }​Jq entry function: Abbreviation: $(function() {}) Standard: $(document) ready(function () ...

Added by David Bethel on Sun, 02 Jan 2022 09:17:09 +0200

2021-08-05 function basis 2

3. Return value of function If the return keyword is not written in the function, the function returns undefined by default <script> function f1(){ var a = 1; var b = 2; } var a = f1(); console.log(a); </script> If there is a return keyword in the function, the value after return is returned <script> function f ...

Added by MrPixel on Sun, 02 Jan 2022 09:04:09 +0200

forEach, map, and for loops

forEachno return valuevar a = [1,2,3,4,5] var b = a.forEach((item) => { item = item * 2 }) console.log(b) // undefinedCannot interrupt executionThe execution cannot be interrupted during forEach traversal. If you want to meet certain conditions, the traversal will be interrupted. Use the for loop.var arr = [1, 2, 3]; for (var i = 0; i & ...

Added by craigtolputt on Sun, 02 Jan 2022 08:40:34 +0200

async and await are actually syntax sugars of generator and promise

Async keyword is used to declare asynchronous functions. await is used to change asynchronous code into synchronization in async functions and block code execution For those unfamiliar with promise and generator, you can take a step-by-step look at these articles Understanding and use of Promise (I) Understanding and use of Promise (II) Step b ...

Added by cbesh2 on Sun, 02 Jan 2022 06:27:33 +0200

[React basic series] controlled form vs uncontrolled form

The previous learning section introduced the use of some form contents - the previous cases basically used input. Next, learn the difference between controlled forms and uncontrolled forms, and learn the knowledge points of uncontrolled components through uncontrolled forms. Controlled forms refer to forms whose states are managed by React ...

Added by D_tunisia on Sun, 02 Jan 2022 06:23:27 +0200

javascript composition - ECMAScript, bom, dom

1. javascript composition 3. Composition: 1 Basic grammar 2 bom 3. dom 1.1 ECMAScript (some syntax of js) ECMA:Organization, European Computer Association (standards) 1.2 BOM: Browser Object Model -- browser object model js script control browser The objects contained in bom are: bom contains dom How to say this -- Window means W ...

Added by morpheus.100 on Sat, 01 Jan 2022 21:25:38 +0200

Building a component library from 0 to 1 - Lesson 4

Section IV engineering construction of component library Reference video link: [I want to open source] personally taught by Huawei leaders, Vue DevUI open source guide 04: project initialization and jsx support for engineering construction of component library_ Beep beep beep_ bilibili Reference documents: [I want to open source] Vue DevUI op ...

Added by blizzard on Sat, 01 Jan 2022 17:12:38 +0200

Cypress condition test

Condition test The following programming paradigms can be clearly expressed: If X, then Y, else Z Today, modern JavaScript applications are highly dynamic and variable. Their state and DOM change over time. The problem with conditional testing is that it can only be used when the state is stable. In modern applications, it is often impo ...

Added by dsjoes on Sat, 01 Jan 2022 16:36:48 +0200