Canvas -- picture combination

In Canvas drawing area, when two or more graphics overlap, the default is that the newly drawn graphics are on top of the already drawn graphics. However, sometimes we do not need this default style, we need to modify the combination mode of graphics. By modifying the attribute value of globalCompositeOperation, we can modify t ...

Posted by hush2 on Tue, 31 Dec 2019 02:12:39 -0800

Dtree add checkbox

I. objectives To display data in a tree structure, each node (except the root node) has a checkbox in front of it. At the same time, click the parent node to select all or none of the child nodes. When all the child nodes are selected, the parent node is selected, as shown in the following figure: Note: I changed the display icon to false (I do ...

Posted by FillePille on Tue, 31 Dec 2019 00:38:44 -0800

How to solve the problem that html page can't use template page

For HTML+ajax development front-end, many times the page will have some fixed content, such as a switch at the bottom, which is equivalent to a tab. Many pages will use it. It is certainly not wise to write one page. Once used ifream to implement, ha ha... Use a js file and pull one for each page. This is also OK. Every time ...

Posted by dmarchman on Mon, 30 Dec 2019 22:18:09 -0800

Simple implementation of long polling based on HTTP

The common communication mode between Web client and server based on Ajax (http) is divided into short connection and long polling. Short connection: every time the client and the server perform HTTP operation, they establish a connection, and the connection will be interrupted when the task ends. In the long polling mechanism, the client reque ...

Posted by rubenc on Mon, 30 Dec 2019 21:47:05 -0800

rem, viewport, 1px adaptation

###rem adaptation Advantages: meta tags can be used to achieve proportional scaling Disadvantages: conversion is difficult Core idea: Based on REM, the element unit in layout is rem, and the font size of html root element is set to screen width rem adaptation: large design drawings and relatively many elements (750px,1080px) ...

Posted by (RL)Ian on Mon, 30 Dec 2019 13:51:16 -0800

Achieve Baidu paging effect

This time, we mainly use: jquery+angularjs+bootstrap to achieve paging effect Test tool: HBuilder First of all, we need to analyze the principle of Baidu paging. Here is my screenshot of paging First, create a project, create a page, and add json data Import corresponding js and cs Start writing First, import js and ...

Posted by Imothep on Mon, 30 Dec 2019 09:41:38 -0800

ajax and JSON requests -- encapsulation

ajax: function ajax(opt) { //Intercession path var url; if(opt.url){ url = opt.url; }else{ console.log('Please enter the request path'); } //Request type var type = opt.type || 'GET'; //Callback function var callback = opt.callback || function (msg) { }; //Request data ...

Posted by FraXTC on Mon, 30 Dec 2019 08:51:39 -0800

ionic2 geolocation, transforming geolocation coordinates into Baidu coordinates and Gaud map coordinates

Install the geolocation plug-in and execute the following command npm install --save @ionic-native/geolocation Declare the geolocation plug-in in app.module.ts import { Geolocation } from '@ionic-native/geolocation'; @NgModule({ providers: [ { provide: ErrorHandler, useClass: IonicErrorHandler }, Geolocation ...

Posted by TechGuru on Sun, 29 Dec 2019 09:03:16 -0800

JavaScript playing with time object Date

JavaScript 0x01 content introduction Many friends will encounter various time related problems in the process of development, such as obtaining a specific time stamp, formatting the time object, etc. This article will help you to summarize and solve some common time problems. You can regard it as a dictionary article for futu ...

Posted by cage on Sat, 28 Dec 2019 11:56:30 -0800

The basic implementation of express middleware system

I always think that express middleware system is very vivid in this kind of flow processing, just like the processing pipeline, each link is completing its own work for different parts of the same product, and finally gets a finished product. Today, we will implement a simple [middleware queue]. I. API level Initialization method let middlew ...

Posted by Gamerz on Sat, 28 Dec 2019 10:42:11 -0800