记录思路,仅供参考

在表格渲染完成后,在done回调函数中给分页动态加点击事件,

layui数据表格分页加载动画,自己定义加载动画,"加载中..."

layui数据表格分页加载动画,自己定义加载动画,"加载中..."

layui数据表格分页加载动画,自己定义加载动画,"加载中..."

关闭"加载中..."动画也是在 done回调函数中关闭

这是我实现的思路,记录给大家参考.


  , done: function (res, curr, count) {
        // 添加分页加载动画的函数    
        $('.layui-laypage > a').each(function(){
            $(this).attr('onclick',"pageLoading(this)");
        })
        top.layer.close(loadingIndex); // 渲染完成后关闭动画
    }

/**
 * 分页请求的loading动画
 * @param {当前点击的dom} that 
 */
function pageLoading(that){
   var disa = $(that).hasClass('layui-disabled');
   if(disa){ // 如果是最后一页或者是只有一页,那就不可点击
       return false;
   }
   loadingIndex = pageCommon.layerLoad(true); // 打开加载中动画
}

相关文章:

  • 2021-04-05
  • 2021-04-06
  • 2021-04-06
  • 2021-04-07
  • 2021-04-08
  • 2021-12-09
  • 2021-12-09
  • 2021-04-20
猜你喜欢
  • 2021-11-07
  • 2021-12-12
  • 2021-09-10
  • 2022-12-23
  • 2021-09-04
  • 2021-11-29
  • 2021-04-04
相关资源
相似解决方案