Jquery in the scroll () event, I want to judge whether the current scroll bar is still vertical;I started to use the global variable to record the scrollTop value for determination. If the front and back values are not changed, the system will
If you cannot understand the operating mechanism of the javaScript language, or simply put, you cannot grasp the execution sequence of javascript, it is like bole cannot control the horse, let the horse go, go around.
So how does JavaScript parse it?
This is a vertical navigation on the side created by using jquery animation effects and css. The entire pop-up process is smooth and the code is simple. If you are looking for an animated vertical navigation, you can try this. The following figure
In the past, you may directly set self = this or that = this, and so on. this will certainly work, but using Function. prototype. bind () will be better and look more professional.The following is a simple example:
Copy codeThe Code is as
Insert sorting is highly efficient when performing operations on data in almost sorted order, that is, linear sorting can be achieved.However, insert sorting is generally inefficient, because insert sorting can only move one bit of data at a
Sometimes you may wonder that when using JavaScript, you only need to assign a value to a system variable to trigger a series of operations.
However, when writing Js, we modified a custom variable, but not even P. Is it depressing?
In fact, now we
; (Function ($) {$ (function () {$ ('[data-qqmotion-input]'). each (function () {var qm = new qqmotion (this) ;}) var qqmotion = function (e) {var $ e =$ (e ); var $ parent = $ e. parent (); this. $ icon = $ e; // optimize the skin using parent.css (
Before getting started, let's look at Javascript Promise:Copy codeThe Code is as follows:Var p = new Promise (function (resolve, reject ){Resolve ("hello world ");});P. then (function (str ){Alert (str );});1. then () returns a Forked Promise
What
As a beginner in development, this is just a personal backup. It would be nice if it could be helpful (I used php for development, but this is js, which has little impact on it)Here are several questions:1. The script tag cannot be displayed on the
ReplaceChild (a, B) is used to replace existing elements in the document.Parameter a: the node to be inserted,Parameter B: the node to be replacedCopy codeThe Code is as follows:Var oDiv = document. getElementById ("guoDiv ");Var oSpan = document.
The cloneNode (a) method accepts a Boolean parameter, indicating whether to copy data in depth.True: Performs deep copy to copy the current node and the entire subnode tree.False: copy the node only.The node copy returned after the copy belongs to
This article mainly introduces how to format a number into an amount in js. You can use the plus or minus commas to process the amount. A code to format the amount. For more information, see.
Example 1: change the number 1111111 to 11,111,111.00 and
This article mainly introduces the js method for deeplink (determine whether the app is installed on the mobile phone). If you need it, refer
Code function:
Determine whether an app is installed on a mobile phone or tablet
If it is installed, the
Cutting an image is not really cutting, but it is just a part of the image with CSS. The advantage of this is that it reduces the number of requests for images when opening a webpage. There are two main methods: one is the background image of an
Plug-in download: https://github.com/GBKS/Wookmark-jQueryOfficial homepage: http://www.wookmark.com/jquery-plugin
After downloading the plug-in, reference the plug-in JS file on the webpage:Copy codeThe Code is as follows:HTML code structure:Copy
Function sAlert ()
{
Var msgw, msgh, bordercolor;
Msgw = 450;
Msgh = 120;
Titleheight = 25;
Bordercolor = \ "# effece8b \";
Var sWidth, sHeight;
SWidth = screen. width; // obtain the width and height of the screen. For other parameters, see the
Today, I wrote a question about the double-click event of JQ to prevent multiple submissions. In addition, the function can be defined in batches to improve the accessibility and dynamically bind element events through methods. In addition, the
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service