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:

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
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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

How to implement file upload and processing in FastAPI

How to take photos and upload them on computer

Simple steps to upload your own music on Kugou

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

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