Prevent default behavior

Default behavior For example, the default behavior of a link label is jump, and the default behavior of submission button is submission, which prevents default behavior from interacting with the user before default behavior occurs, and chooses what behavior to perform after obtaining the user's choice. The ways and codes of different browser ...

Added by simcoweb on Fri, 24 May 2019 23:18:41 +0300

Corresponding to HTML dom, learn common jQuery operations

Create node Example: Create a div tag node Var $div = $('<div id = div">I am div </div>'); Insertion node 1. Insert peer nodes after() inserts content after all matching elements, for example: HTML Code: <p> I want to say:</p> jQuery code: After (&q ...

Added by playa4real on Fri, 24 May 2019 01:27:21 +0300

Touch module reading Zepto source code

As we all know, for historical reasons, click events on the mobile end will have a delay of about 300 ms. Zepto's touch module solves the problem of click delay on the mobile end, and also provides sliding swipe events. Read the Zepto source series on github. Welcome star: reading-zepto Source version The source code for this article is zepto1. ...

Added by xiao on Thu, 23 May 2019 20:50:18 +0300

js Base-DOM-Attribute and CSS

DOM - Properties and CSS 1. Attributes HTML elements consist of a tag and a set of name/value pairs called attribute s. 1. HTML attributes as attributes of Element s The HTMLElement object representing an HTML document element defines read and write attributes that map the HTML attributes of the element. HTMLElement defines generic ...

Added by priti on Thu, 23 May 2019 19:08:13 +0300

Front-end: the difference between pageY, clientY and offsetY & drag effect optimization

Preface I wrote an article before. Articles on drag effects in html and JavaScript The contents of this article are quite simple, and there will be errors in fact. The effect of the errors is as follows: The same interface, we slide to the top, but the effect is correct: Why, in fact, because of the location, when we dra ...

Added by camoconnell.com on Sun, 19 May 2019 05:01:54 +0300

Mobile Compressed Pictures, Upload Pictures and Compress-lrz.all.bundle.js Plug-in

In recent days, the company has a need to change bank cards. It uses the function of uploading pictures (uploading ID cards and bank cards). Then I Baidu, which synthesizes the information on the Internet, has worked out. Now I share my experience with you. First of all, we refer to plug-ins, which must be downloaded, ...

Added by noelswanson on Fri, 17 May 2019 07:14:13 +0300

Implementation principle of two main methods of front-end routing

Original Link: https://segmentfault.com/a/1190000007238999 Early routes were implemented on the back end, reload ing pages based on url caused great pressure on the back end as the page became more and more complex. In order to alleviate background pressure and front end user experience, the method of partial refresh of ...

Added by Derokorian on Tue, 14 May 2019 22:28:05 +0300