FastAdmin自定义滚动条

FastAdmin列表 底部右侧滚动条设置和底部统计代码 ">当前页·合计:</td>table.find('#total').remove();// 创建合计行并插入表格底部。// 遍历数据计算总和。 阅读详情

效果

实现过程

HTML代码

<style>
    .custom-scrollbar {
        position: fixed;
        /*bottom: 0px;*/
        height: 20px;
        width: 97.5%;
        overflow-y: scroll;
        overflow-x: scroll;
        z-index: 100;
    }

    #scrollDivTable{
        height: 20px;
    }

    /*原滚动条不显示*/
    /*.fixed-table-body::-webkit-scrollbar {*/
    /*    display: none;*/
    /*}*/
</style>

<div id="scrollDiv" class="custom-scrollbar">
    <div id="scrollDivTable"></div>
</div>

JS代码

在对于JS文件中的 var table = $("#table"); 下方添加如下代码:

// 自定义滚动条功能
var setupCustomScrollbar = function() {
    var $table = $('#table');
    var $scrollDiv = $('#scrollDiv');
    var $scrollDivTable = $('#scrollDivTable');

    // 移除可能存在的旧的克隆表格
    $scrollDivTable.empty();

    // 创建一个与原表格列宽相同的表格
    var $clonedTable = $table.clone().removeAttr('id').addClass('cloned-table');
    $clonedTable.find('tbody').remove(); // 只需要表头
    $scrollDivTable.append($clonedTable);

    // 同步原表格和克隆表格的列宽
    function syncColumnWidths() {
        $table.find('thead th').each(function(index) {
            var width = $(this).outerWidth();
                $clonedTable.find('thead th').eq(index).outerWidth(width);
            });
        $scrollDivTable.width($table.outerWidth());
    }

    // 绑定滚动事件
    $scrollDiv.off('scroll').on('scroll', function() {
        $table.parent('.fixed-table-body').scrollLeft($scrollDiv.scrollLeft());
    });

    $table.parent('.fixed-table-body').off('scroll').on('scroll', function() {
        $scrollDiv.scrollLeft($(this).scrollLeft());
    });

    // 窗口调整大小时重新同步列宽
    $(window).off('resize.customScrollbar').on('resize.customScrollbar', syncColumnWidths);

    // 表格数据加载完成后同步列宽
    $table.on('post-body.bs.table', function() {
        setTimeout(syncColumnWidths, 0); // 使用 setTimeout 确保在 DOM 更新后同步
    });

    // 初始同步列宽
    setTimeout(syncColumnWidths, 0);
};
onPostBody: function() {
    setupCustomScrollbar();
}

FastAdmin非表格场景下的全屏弹窗技巧:a标签+data-area参数详解 本文详细解析了在FastAdmin框架中,如何在表格之外的任意页面位置使用原生<a>标签配合data-area参数实现弹窗尺寸的精准控制。文章重点介绍了实现100%全屏弹窗的技巧,并深入讲解了弹窗触发机制、参数组合应用以及常见问题排查,帮助开发者摆脱对表格JS配置的依赖,实现灵活的页面级交互。 阅读详情

相关推荐

FastAdmin弹窗自定义全攻略:从按钮配置到宽高调整一步到位

本文详细解析FastAdmin弹窗自定义技巧,从按钮配置到宽高调整全面覆盖。通过实战代码演示百分比/固定像素/自适应三种尺寸设置方式,并分享多弹窗协同、响应式适配等进阶方案,帮助开发者打造高效交互体验。重点讲解`data-area`参数实现弹窗尺寸精细控制。

delta的博客 306

fastadmin:如何实现表格滚动条

fastadmin:如何实现表格滚动条

weixin_46001736的博客 790

FastAdmin中如何优雅地实现弹窗功能?这些细节你可能忽略了

本文深入探讨了在FastAdmin框架中实现优雅弹窗功能的进阶技巧。文章不仅介绍了如何通过自定义宽高等基础配置满足需求,更重点阐述了如何构建交互骨架、深化用户体验、优化工程化代码组织,并兼顾性能与可访问性,帮助开发者将弹窗从“能用”提升到“优雅”的境界。

weixin_28197941的博客 431

修改滚动条样式

将进度条样式(如图): ⬇ 修改为(如图): ⬇ 代码如下: .scroll::-webkit-scrollbar{ height: 5px !important; width: 5px !important; } .scroll::-webkit-scrollbar-thumb { border-radius: 0; border-style: dashed; background-color: rgba(157, 165, 183, 0.4); bo

Lycoriy的博客 1053

滚动条插件

JCarouselLite是一款jquery插件,可以控制文档元素滚动,丰富的参数设置可以控制滚动的更多细节,是一款不可多得的滚动插件。

腾讯滑块验证码collect参数逆向与JSVMP对抗实战

本文深入解析腾讯滑块验证码collect参数的逆向过程与JSVMP虚拟机对抗技术。通过详细的环境搭建、抓包分析和JSVMP逆向技巧,揭示collect参数的生成逻辑与加密流程,并提供完整的模拟实现方案和常见问题排查方法,助力开发者突破腾讯天御验证码的防护机制。

weixin_29009501的博客 1576

FastAdmin table列表字段宽度太长,以及滚动条的解决办法。

当字段文字过多,就会出现图片这种情况。 解决办法 {field: 'video_introduction', title: __('Video_introduction'), formatter: function(value){return value.toString().substr(0, 20)}} 通过对相应字段添加 formatter方法,对显示的字段截取一定长度,从而达...

Cloud_lengfeng的博客 9610

RocketMQ 为什么要自己做一个 NameServer ?RocketMQ 5.x 版本中的 proxy、controller 和 container 分别有什么用 ?

1.独立运行的分散结构 2.简化实现,容忍部分数据不一致 Proxy:多语言支持、简化开发 Controller: 提高 Broker 的性能 Container:提高资源利用率,平衡负载

xaiobit_hl的博客 1490

进度条ProgressBar的功能和用法

进度条ProgressBar的功能和用法 通过style属性可以为progressBar指风格 ProgressBar提供如下方法操作进度的完成百分比 setProgress(int)设置进度的完成百分比 incrementProgressBy(int)设置进度条的进度增加和减少,正为增加,负为减少。 package com.example.bao; import java.util.ArrayList; import java.util.HashMap; import java.util.List; im

weixin_44701192的博客 1128

多智能体系统在AI物流优化中的实际应用案例

订单波峰波谷难应对(如双11订单量暴增300%);动态干扰难处理(如突发交通拥堵、客户临时改地址);全局优化难实现(单辆车最优≠整体最优)。本文聚焦“多智能体系统(MAS)”这一AI技术,讲解其如何通过“群体智能”破解物流调度难题,并结合实际案例展示落地效果。本文从“生活故事→核心概念→技术原理→实战案例→未来趋势”逐步展开,用“快递员团队协作送外卖”类比MAS运作,结合Python代码模拟任务分配,最后通过某物流企业的真实项目验证效果。

AIGC应用创新大全的博客 1632

YOLO11有效改进专栏目录

YOLO11改进专栏导航

A1983Z的博客 3679

Fastadmin 后台列表页面列自定义点击事件

在做项目过程中经常遇到某一列使用富文本填写内容,如果使用使用table默认展示方式会导致该列展示很长,倒是使用体验差。可以在该列加上一个按钮,点击按钮后后弹窗展示改字段内容。

fangwenkai的博客 2591

Android14 Qcom 从Framework到Driver带你连接WIFI(一)

前面已经讲完了WIFI打开的流程,那么通过UI这时候是可以选择需要连接的网络进行连接。从这里开始我们看连接的流程。

IAYLBL的博客 696

滚动条悬浮(可以优化)

// 滚动条 fixTableScroller: function() { let tableH = $(".master-table-container").height(); // table高度 let winH = $(window).height(); // 浏览器高度 let ol = 0; // table左边距 let wTop = 0; ...

XiaoYi0215的博客 2187

宇树 Qmini 双足机器人完全开源:3D打印+5小时组装,新手也能玩转!

教育教学,成为学校里的竞赛竞技,实验课程,论文设计的本体;开发者可以根据开源资料轻松集齐所有零部件,结构件可全部通过3D打印完成(几乎完全不需要任何机加工零部件),搭配宇树的高可靠性电机和标准电池,客户打印完零部件后,大概仅需要3~5小时的手工组装即可得到一只可爱的Qmini小双足机器人本体。一起推动机器人的未来发展,创新没有边界,创造力是无限的,Qmini就是你的第一步,如果你也想做一个能动、能学、还能萌的小双足机器人,现在就可以动手了,全开源、真低门槛、只差你的3D打印机和一点点耐心。

雕爷学编程 1890

OGRE 3D----2. QGRE + QQuickView

将 OGRE(面向对象图形渲染引擎)集成到使用 QQuickView 的 Qt Quick 应用程序中,可以在现代灵活的 UI 框架中提供强大的 3D 渲染功能。本文将指导您如何在 QQuickView 环境中设置 OGRE。

charce_you的专栏 914

Fastadmin下拉选择菜单的实战配置指南

本文详细介绍了在Fastadmin框架中配置动态下拉选择菜单的完整实战流程。通过语言文件定义、模型数据准备、控制器串联和视图模板集成四个核心步骤,并结合用户类型选择实例,深入讲解了如何实现数据绑定、选项国际化、编辑回显以及使用Bootstrap Select插件增强功能,帮助开发者高效构建后台表单组件。

weixin_29001419的博客 199

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

使用jquery.mCustomScrollbar自定义滚动条(1)

参考博客:https://blog.youkuaiyun.com/cdnight/article/details/41351505 api网址:http://manos.malihu.gr/jquery-custom-content-scroller/# 常用的theme: dark light light-2 light-3 light-thick light-thin d...

weixin_30456039的博客 210

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

滚动条不显示

原项目中,需要用iframe嵌入子页面,但是子页面有滚动条,而父页面也有滚动条,于是出现双滚动条的情况 解决办法是把子页面的滚动条不显示 参考链接:http://blog.youkuaiyun.com/qq_2842405070/article/details/70238829

strayyiyi的博客 465

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

滚动条样式设置

滚动条样式效果图 具体代码如下 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"&g

limif的博客 134

FastAdmin实战:两种灵活控制弹出层尺寸的定制化方案

本文深入解析了在FastAdmin框架中灵活控制弹出层尺寸的两种核心方案。针对表格内操作按钮与独立A标签按钮两种常见场景,详细阐述了如何通过`data-area`属性实现自定义宽高设置,并提供了实战代码、避坑指南与效能优化建议,帮助开发者提升后台管理系统的用户体验。

weixin_29008805的博客 346

3步解决Layui Layer组件滚动条异常:从踩坑到完美适配

Layui是一套遵循原生态开发模式的Web UI组件库,采用自身轻量级模块化规范,易上手,可以更简单快速地构建网页界面。在使用Layui的Layer弹出层组件时,滚动条异常是开发者常遇到的问题,本文将分享3个实用步骤,帮助你轻松解决这一难题。 ## 一、快速定位问题根源:认识scrollbar配置项 Layer组件的滚动条异常通常与`scrollbar`配置项密切相关。在[src/compon

gitblog_00578的博客 414

将滚动条(scrollbar)保持在最底部的方法

将滚动条(scrollbar)保持在最底部的方法 - 滚动条, scrollbar, 页面底部, 聊天窗口, 将滚动条(scrollbar)保持在最底部的方法 function add() { var now = new Date(); var div = document.getElementById('scrolldIV'); div.innerHTML = div.innerH

GraceUp 4594

FastAdmin Bootstrap-Table 增加固定表头功能

在 FastAdmin 中使用 Bootstrap-Table 进行表格展示,可以通过在require-table.js文件Table.api中的增加fixedheader方法实现固定表头的功能

qq_38316379的博客 2555
上一篇: FastAdmin添加图标库
下一篇: datetimepicker组件在通用搜索中样式异常
withoutfear
博客等级 码龄13年 541粉丝 79原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

withoutfear

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值