前端页面怎么添加遮罩层

Web前端开发 HTML5案例之图片遮罩效果 图片遮罩效果 阅读详情

关于遮罩层,最常用到的场景就是在前端请求过程中和导航栏下拉

1、在页面添加一个div模块

    <!-- 遮罩层 -->
    <div class="overlay" v-show="overlayShow"></div>

2、添加css样式

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
  }

附上一张效果图:

WEB前端-CSS-静态购物页面V3 这是之前静态页面的第三版相对于第二版,这一版新增了一个纯html-css实现的简易注册页面,并增加了遮罩层,明天会将这个注册页与JavaScript&DOM结合,实现微博前端的简易交互。<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" http-equiv="X-UA-COMPATIBLE" content="IE=e 阅读详情

相关推荐

前端如何实现遮罩功能

前端如何实现遮罩功能

kerryqpw的博客 4904

前端遮罩层

自定义遮罩: 1:自定义div。设置id 2:自定义class。显示范围 3:设置隐藏和显示。hide(),show() <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>遮罩层</title> <style> .dark{ z-index: 100; positio

kang1011的博客 1801

javascript实现遮罩层动态效果实例

大家在网页上注册登录的时候,经常会看见弹出的遮罩层。 我这里实现的效果是:点击按钮弹出遮罩层,遮罩层下的内容不可选,并且登录框随着鼠标滚轮的下滑,动态的浮动到页面某个位置,点击关闭按钮关闭遮罩层。 这是鼠标滚动下滑到页面中间某部分时画面。虽然界面简单颜色随意,能看出效果才是最重要的哈哈哈哈。 以下是html界面: <body> <!-- 主界面 --> <div class=main> <div xss=removed>登录</div> </div> <!-- 设置遮罩层的div --> <div id=shade></div> <!-- 设置登录框 -->

前端开发中遮罩层的作用和使用场景

登录/注册框:当网站需要用户登录或者注册时,可以使用遮罩层覆盖在页面上方,防止用户直接点击其他链接跳转到其他页面。模态框:当弹出模态框时,遮罩层可以覆盖在整个页面上,使得用户只能与模态框交互,从而实现了浮层的视觉效果。页面加载过程中:当页面需要加载一些耗时资源(如图片、视频等)时,可以使用遮罩层提示用户页面正在加载中。然后,在 JavaScript 中,我们监听了按钮的点击事件,并在回调函数中将遮罩层的。在上面的代码中,我们首先定义了一个按钮和一个遮罩层。

m0_57742630的博客 3972

设置Solidworks导出文件的坐标系,stl坐标系平移

使用solidworks输出的模型坐标不再原点,怎么平行坐标系,这个方法很简单

weixin_45650767的博客 1万+

Silvaco Atlas入门指南——从零开始掌握半导体器件仿真

本文为Silvaco Atlas半导体器件仿真软件的入门指南,详细介绍了从零开始掌握该工具的核心流程。内容涵盖Atlas的基本概念、仿真流程、核心文件(输入、结构、输出文件)、交互式与批处理两种操作模式,并逐步演示了如何从定义网格、划分区域、设置电极到进行掺杂、选择物理模型并求解,最终获取和分析器件特性的完整步骤。旨在帮助微电子相关专业人员和工程师快速上手这一强大的“数字实验室”,提升半导体器件设计与研发效率。

weixin_29306317的博客 413

自定义前端页面添加遮罩层

var MaskUtils = (function(){           var $mask,$maskMsg;                var defMsg = '正在处理,请稍待。。。';                function init(){            if(!$mask){                $mask = $("&lt;div class=\"d...

涛涛小子的博客 2835

CentOS7安装openGauss5.0.2LTS版本

该文档要根据自己的实际情况调整ip地址。要根据自己的实际网卡调整。

superhanyubo的专栏 2705

前端页面给指定的div添加遮罩层,并且带有加载中的小旋转图片

&#13; 话不多说,先上代码,其实还是比较简单的&#13; &#13; 1 $("&lt;div id='shade' style='opacity:0.85;background:white'&gt;&lt;/div&gt;&lt;img src='${ctx}/static/images/loading2.gif'/&gt;").css({ &#13; 2 posi...

oldmonk 1746

SAP MIGO屏幕增强的具体实施步骤介绍(SE19:MB_MIGO_BADI) <转载>

1.MIGO抬头屏幕增强具体增强实施步骤1.1.创建存储抬头客制化数据的增强表1.2.创建增强结构1.3.创建函数组ZMM_MIGO1.3.1.定义全局变量1.3.2.创建数据处理函数1.4.创建字屏幕9001屏幕PBOendif.endloop.1.5.实施新BADI增强SE19创建BADI实施双击实施类ZCL_MIGO_EN_01exportingendif.endmethod.endif.endif.exportingendmethod.

qq_55488207的博客 4546

精益六西格玛Python数字化应用开发-Day18 应用场景:家电企业生产效率优化

本文将重点介绍专门针对精益六西格玛黑带使用场景的 Python 库,这些库功能侧重于数据分析和流程优化,特别适用于 DMAIC 方法论和看板管理。考虑到读者具备中高级Python 使用经验,我们将深入探讨各库的高级功能和实际应用应用场景。 某家电企业生产线自动化程度高,数据量巨大,希望通过精益管理提升生产效率。企业借助 Python 脚本,打通各类数据源(MES、ERP、设备日志),自动归集生产数据,分析各工序的生产节拍、设备停机、效率损失,快速定位瓶颈环节

m0_56592100的博客 913

遮罩层挡住了图片下面部分不能点击

给遮罩层加这个css 属性。

m0_62336925的博客 234

Altium Designer (AD) 设计软件高频面试题及参考答案(3万字长文)

在Altium Designer(AD)中,设计复用是一种关键的策略,它允许设计师在多个项目中重复使用经过验证的设计元素,如原理图符号、PCB布局、元器件封装和设计规则集。在Altium Designer (AD) 中,手动布线和交互式布线是PCB设计中常见的两种布线模式,它们提供了设计师对布线路径的直接控制,特别是在处理复杂或关键信号路径时尤为有用。在Altium Designer (AD) 中进行电路级仿真是一项重要的设计验证步骤,它允许设计师在实际制造之前对电路的行为进行预测和分析。

大模型大数据攻城狮的专栏 4797

easyExcel导出大数据量EXCEL文件,前端实现进度条或者遮罩层

导出时,由于查询特别耗时,所以点击之后页面会看上去没有反应,通过进度条或者遮罩层的方案来解决问题

weixin_42285408的博客 1959

【教程4>第1章>第12节】通过Verilog读取txt格式数据进行测试并将结果导入到matlab

我们在verilog的testbench中,调用txt文件,将上述正弦样本数据作为测试激励输入到verilog模块中。通过这个方法,可以将一些较为复杂的数据导入到verilog中,进行FPGA数据处理模块的开发。即通过w方式打开一个新的txt文件,然后将verilog的输出保存到XY1.txt文件中。这个部分是txt文件的路径,实际使用时,修改为您自己的路径,或者将txt文件放在和我一样的路径中。这个是数据长度,matlab产生的txt多少长度,这个参数就修改为多少长度。这个txt就是保存这段数据的文件。

FPGA/MATLAB学习教程/源码/项目合作开发 1407

Apollo Control——超详细入门教程(六):MPC二次规划问题转化

专栏文章列表 Apollo Control——超详细入门教程(一):基于道路误差的车辆动力学模型 Apollo Control——超详细入门教程(二):连续状态空间方程离散化与离散LQR公式推导 Apollo Control——超详细入门教程(三):基于Frenet坐标系及XY坐标系的多项式轨迹生成 Apollo Control——超详细入门教程(四):控制模块轨迹误差计算 Apollo Control——超详细入门教程(五):油门刹车标定表之双线性插值算法 ...

凉了鸭的博客 2239

怎样阻止页面滚动穿透

在前端的开发中,经常会遇到长页面和弹框,触发弹框,会出现遮罩层后面的页面依旧可以滚动,此时就出现了滚动穿透,如何处理呢? 解决方法: 触发弹框时,给最外层的div添加样式 话不多说,上代码 .prevent_touch_move_box { position: fixed ; overflow: hidden; width: 100%; height: 100%; top: ...

一只大海 3141

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

JQuery 遮罩层

1.样式如下设置:   Js代码   "text/css">      .mask {                position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;              z-index: 1002; left: 0px;

同学小江的博客 353

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

解决Vue页面黑底红字遮罩层报错:Unknown promise rejection reason (webpack-internal)

摘要:Vue前端页面出现黑底红色报错遮罩层,报错信息显示"Unknown promise rejection reason"。该问题由Webpack DevServer的错误覆盖功能引发,当出现编译错误时会显示全屏报错遮罩。解决方法是在vue.config.js中配置devServer.client.overlay为false来禁用该功能,修改后重启项目即可消除报错遮罩层。此方案有效解决了问题,使开发环境恢复正常。

baifangfang521的博客 682

深度学习工具包 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")

javaScript实现遮罩层效果:点击登录按钮,弹出登录框,此时页面的其他部分无法点击,关闭登录框,页面才可以点击

<style> *{ margin:0px; padding:0px; } body,html{ width:100%; height:100%; } .div1{ text-align:center; } button{ ...

小福气的博客 1427

浏览器窗口弹出及配置

1. 操作弹出浏览器窗口 var temp = window.open('url',' name','width=500,height=600,menubar=no,toolbar=no,status=no,scrollbars=no') name:可选,指定target属性或窗口的名称,支持值: _blank - URL加载到一个新的窗口。这是默认 _parent - URL加载到父框架 _self - URL替换当前页面 _top - URL替换任何可加载的框架集 name - 窗口名称 2.浏览

qq_44839718的博客 385

css中控制俩个盒子重叠上下滚动禁止的效果

给遮罩层添加@touchmove.prevent即可。阻止遮罩层穿透事件进行页面滚动效果。

2301_78038003的博客 379

bootstrap+springboot,ajax进行提交时,使用$(““).modal(‘hide‘)将弹出框进行隐藏,但是出现了页面点击不了的问题

这是前几个月项目遇到的问题,查找了资料,隐约记得是有残留没有关掉,在页面点击f12找到了那些没有关掉的内容,使用了以下代码进行清除 如下面两张图所示,我就是这两个地方没有清掉导致页面点击不了 所以我在ajax提交的代码中添加了以下代码,问题就得到解决。 $(".modal-backdrop").remove(); $("#myModal").removeClass("show") 但是之后问题又来了,虽然提交之后能正常点击页面,但是有时候又会出现弹出框出不来,但是遮罩层又出来的情况。 查找了点资料,

qq_40386177的博客 929

cursor,click失效原因

设置了 pointer-events: none; 上面有遮罩层 z-index提高层次

珎珎啊 1250
上一篇: 踩坑!ios css设置背景色和圆角边框bug
下一篇: vue可拖动的悬浮按钮实现方案,简单实用
饭小勤
博客等级 码龄7年 20粉丝 22原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值