Jquery块ui仅在函数的ajaxStart上显示
我目前正在使用Blockui阻止页面,并在执行ajax功能时显示加载的gif。请看这里:Jquery块ui仅在函数的ajaxStart上显示,jquery,ajax,loading,blockui,Jquery,Ajax,Loading,Blockui,我目前正在使用Blockui阻止页面,并在执行ajax功能时显示加载的gif。请看这里: $(document).ready(function() { //shows loading screen whilst posting via ajax $().ajaxStart(function() { $.blockUI({ message: '<h1><img src="../images/layout/busy.gif" /&
$(document).ready(function() {
//shows loading screen whilst posting via ajax
$().ajaxStart(function() {
$.blockUI({ message: '<h1><img src="../images/layout/busy.gif" /> Just a moment...</h1>' }); });
$().ajaxStop($.unblockUI);
//Load table from table.php
//Timestamp resolves IE caching issue
var tsTimeStamp= new Date().getTime();
$.get('table.php',
{action: "get", time: tsTimeStamp},
function(data){
$('#customertable').html(data).slideDown('slow');
});
return true;
});
$(文档).ready(函数(){
//通过ajax发布时显示加载屏幕
$().ajaxStart(函数(){
$.blockUI({message:'稍等…});});
$().ajaxStop($.unbui);
//从table.php加载表
//时间戳解决IE缓存问题
var tsTimeStamp=new Date().getTime();
$.get('table.php',
{操作:“获取”,时间:tsTimeStamp},
功能(数据){
$('#customertable').html(数据).slideDown('slow');
});
返回true;
});
我的问题是,每次执行ajax函数时,它都会阻塞页面。如何使其仅在执行某些功能时出现您必须从通用ajaxStart和ajaxStop事件中取消阻止/取消阻止,并根据具体情况进行阻止/取消阻止:
$.blockUI({ message: '<h1><img src="../images/layout/busy.gif" /> Just a moment...</h1>' });
$.get('table.php',
{action: "get", time: tsTimeStamp},
function(data){
$.unblockUI();
$('#customertable').html(data).slideDown('slow');
});
$.blockUI({消息:'稍等…');
$.get('table.php',
{操作:“获取”,时间:tsTimeStamp},
功能(数据){
$.unbui();
$('#customertable').html(数据).slideDown('slow');
});