Home Web Front-end JS Tutorial jquery.blockUI.js upload scrolling wait effect implementation ideas and code_jquery

jquery.blockUI.js upload scrolling wait effect implementation ideas and code_jquery

May 16, 2016 pm 05:40 PM
upload scroll wait

Requested url:

Copy code The code is as follows:

function request(url, onSuccess, paras , method, isAsync, isMask) {
$.ajax({type:method,url:url,async:isAsync,data:paras,success:function(request){onSuccess(request,isMask);},error: function(e) {if(isMask)
$('#div_mask').unblock();},beforeSend:function(e){if(isMask)$('#div_mask').block({message: '<img src="/ets/image/common/loadingCHS.gif"/>'});}});
}

When requesting url synchronously or asynchronously in ajax , when responding to the returned request, there is a waiting process.
Copy code The code is as follows:

success:function(request){onSuccess(request,isMask );},error:function(e) {if(isMask)$('#div_mask').unblock();},beforeSend:function(e){if(isMask)
$('#div_mask') .block({message:'<img src="/ets/image/common/loadingCHS.gif"/>'});}

1. What follows success here is Method ({onSuccess) removed after successfully returning the response.
2. Error is the method to adjust when there is an error (error: function(e) {if(isMask)$('#div_mask').unblock();}). unblock() is a method of jquery.blockUI.js, which turns off scrolling when an error occurs.
3. BeforeSend sends data when responding and starts calling the method $('#div_mask').block({message:'<img src="/ets/image/common/loadingCHS. gif"/>'},
block is the method of jquery.blockUI.js, open the div for scrolling.
Rendering:
jquery.blockUI.js upload scrolling wait effect implementation ideas and code_jquery
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP sends emails asynchronously: avoid long waits for emails to be sent. PHP sends emails asynchronously: avoid long waits for emails to be sent. Sep 19, 2023 am 09:10 AM

PHP sends emails asynchronously: avoid long waits for emails to be sent.

How to implement file upload and processing in FastAPI How to implement file upload and processing in FastAPI Jul 28, 2023 pm 03:01 PM

How to implement file upload and processing in FastAPI

How to take photos and upload them on computer How to take photos and upload them on computer Jan 16, 2024 am 10:45 AM

How to take photos and upload them on computer

Simple steps to upload your own music on Kugou Simple steps to upload your own music on Kugou Mar 25, 2024 pm 10:56 PM

Simple steps to upload your own music on Kugou

How to solve the problem of slow upload speed on Win10 computer How to solve the problem of slow upload speed on Win10 computer Jul 01, 2023 am 11:25 AM

How to solve the problem of slow upload speed on Win10 computer

How to upload lyrics to QQ Music How to upload lyrics to QQ Music Feb 23, 2024 pm 11:45 PM

How to upload lyrics to QQ Music

How to improve computer upload speed How to improve computer upload speed Jan 15, 2024 pm 06:51 PM

How to improve computer upload speed

How to implement scrolling to a specified element position in JavaScript? How to implement scrolling to a specified element position in JavaScript? Oct 22, 2023 am 08:12 AM

How to implement scrolling to a specified element position in JavaScript?

See all articles