javascript-产生页面遮罩层

【小程序】absolute布局防止冒泡事件,点击按钮后出现view弹框还有自定义的遮罩层,点击遮罩层弹框消失 在很多情况下,出于人的习惯,喜欢在非选择或编辑的情况下,喜欢点击遮罩层使弹出框隐藏, 下面自定义一个弹出框,其实就是将一个view标签的内容显示出来。 具体效果如下: 点击按钮时(查看某个具体内容)会弹出一个带有遮罩层的弹出框,上面的内容赋予的点击事件不会因为下层的遮罩层的点击事件产生冒泡行为。 只有点击外层可见的遮罩层或者弹框内自定义的弹框消失按钮才会消失。 代码如... 阅读详情
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.shadow{
				top:0px;
				left:0px;
				right:0px;
				bottom:0px;
				position:absolute;
				background-color: rgba(100,100,100,0.4);
			}
		</style>
	</head>
	<body>
		<input type="button" value="产生遮罩层" onclick="shadow()"/>
	</body>
	<script>
		//产生遮罩层
		function shadow(){
			var div=document.createElement("div");
			div.style.width=document.body.clientWidth+30+"px";
			div.style.height=document.body.scrollHeight+15+"px";
			div.className="shadow";
			document.body.appendChild(div);
		}
	</script>
</html>
遮罩层可以实现在登陆、注册或删除信息时,将整个页面遮罩起来,并且弹出相应的页面,使得页面的交互效果更加明显。
遮罩效果的实现(JavaScript) 通过设置容器元素的样式和使用JavaScript来创建并添加遮罩层,可以在网页上实现各种各样的遮罩效果。遮罩效果是指在网页中添加一个半透明的层,用于覆盖在其他元素之上,以达到遮挡或模糊的效果。在上述示例中,我们创建了一个带有边框的容器元素,并在容器中添加了一个段落元素。文章主要介绍了如何使用JavaScript实现网页上的遮罩效果,通过润色修改标题作为首行,下面将详细说明实现该效果的步骤和相应的源代码。首先,在HTML文档中创建一个容器元素,用于包裹需要添加遮罩效果的元素。的遮罩层,通过设置其。 阅读详情

相关推荐

前端动态上传文件与遮罩层实现

遮罩层是一种覆盖在页面元素之上的半透明或全透明图层,用于在特定操作期间阻止用户与页面的其他部分进行交互。在文件上传场景中,遮罩层能够提示用户正在进行上传操作,防止他们进行可能干扰上传过程的操作。遮罩层是用户界面中的一个常用元素,用于临时覆盖页面上的一部或全部内容,以突出显示某些特定区域或提示信息。其主要功能是为用户提供指引,确保用户专注于当前任务,防止他们与被遮罩的内容发生交互。通常,遮罩层可以设置半透明或完全不透明,能够适应不同的背景颜色和元素。

weixin_42437253的博客 1139

简单生成遮罩层的代码示例

页面上弹出遮罩层的的方法:以下代码可直接复制粘贴到jsp页面相应位置进行使用   /* 遮罩层样式 */ .fullbg{ background-color: black; display:none; z-index:3; position:absolute; left:0px; top:0px; height: 780px; width: 980px; filter:

骨牌的专栏 1252

创建HTML5 SVG遮罩层动画效果

htmltable {th, td {th {pre {简介:本案例展示了如何利用HTML5的SVG技术实现创新的交互设计,特别适用于全屏菜单和页面切换。SVG动画效果通过动态变换遮罩层和路径属性,提供动态视觉体验。案例中包括CSS3动画技术、SVG的<mask>元素使用、JavaScript事件监听,以及可能的jQuery动画控制。项目文件展示了不同遮罩层动画效果,结合了HTML5、CSS3、JavaScript和SVG,旨在提升网页视觉吸引力和用户体验。

weixin_36073714的博客 387

JS学习笔记 | 遮罩层Loading实现

遮罩层Loading实现

cungudafa的博客 2450

JavaScript实现网页遮罩效果

用JavaScript实现的网页遮罩效果,使用了单例保障只创建唯一的遮罩,运用了JavaScript面向对象编程

JSP页面增加遮罩

JSP页面增加遮罩

jsp页面遮罩层

var docEle = function() {             return document.getElementById(arguments[0]) || false;         }         function openNewDiv(_id,i_d) {             $("#id").val(i_d);             var m

B624023251的专栏 4296

js 页面全部遮罩层

js遮罩全部页面,包括鼠标滚动,和上下键的控制,引用jquery编写,调用时需依赖jquery,

jsp页面加载之遮罩层

如果一个页面的数据加载量很大,客户很难辨别页面是否加载完成,就会去点击上面的链接,导致误以为链接失效。  这时,我们需要一个遮罩层,来判断页面是否加载完成,如果没有加载完成,则不能对加载中的页面进行操作。 代码如下:  &lt;%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%&gt; &lt;% Stri...

香辣虾虾 2394

JS原生网页/WAP底部悬浮代码带关闭按钮防常规屏蔽

JS原生网页/WAP底部悬浮代码带关闭按钮防常规屏蔽,随机生成字符串层(非DIV),如<ghjk></ghjk>;随机字符串生成4*10小方格覆盖层(非DIV层),点击小方格跳转指定地址,仿最新广告联盟技术代码

PPPoE上网配置不求人:华为路由器命令行操作指南(2023最新版)

本文提供2023年最新的华为路由器PPPoE上网配置命令行操作指南。通过详细的步骤讲解,从连接设备、创建拨号接口、绑定PPPoE客户端到配置内网与NAT,手把手教你完成配置,并附有验证排错方法,助你轻松实现稳定上网。

s4t5u6v的博客 697

隐藏div框_bootstrap 中使用modal模态框遮罩颜色加深

bug收集:专门解决与收集bug的网站网址:www.bugshouji.com使用 bootstrap + jQuery 做一个后台管理系统, 采用load 方法去加载页面。01问 题部分页面中的模态框,多次点击显示后,模态框颜色加深,具体说明:学生管理中的添加模态框,直接点击没有问题,但是去班级管理中点击添加模态框后,在点添加学生模态框,就会出现这个问题。代码实现,直接复制的boo...

weixin_31754209的博客 230

海思ISP实战:YUV Sharpen参数调试全解析

本文深入解析了在海思ISP平台上进行YUV Sharpen参数调试的实战经验。文章以海思3516EV300芯片为例,详细拆解了EdgeFiltStr、TextureFreq等核心参数的作用与协同策略,并重点阐述了如何通过ISO联动调试,在图像清晰度与噪声抑制之间取得最佳平衡,为图像调试工程师提供了宝贵的避坑指南和实战参考。

grape的博客 222

移动端、pc端,遮罩层滚动穿透问题

常见的解决方式有一下三种: 1. css 之 overflow: hidden; .model-open { overflow: hidden; height: 100%; } 遮罩层显示时将 .modal-open 添加到 html上,删除多余一页的部分,禁止页面滚动。 遮罩层隐藏时,移除.modal-open,恢复页面滚动即可; 缺点: pc端有效,移动端无效 2. js 之...

yiyueqinghui的博客 3499

app逆向分析案例-95分

先把justtrusmeplus打开设置好95分,开始抓包,得到结果为: https://www.95fenapp.com/api_goods/list/v3.0?is_all=1&keywords=%E7%A7%91%E6%AF%94& page=1&page_size=20 &publish_timestamp=0 &scene=2&scene_type=95fen_android_search_personal&sn=SearchList

weixin_41763171的博客 2769

Multisim实战:5分钟搞定一阶RC电路仿真(附示波器波形分析技巧)

本文通过Multisim软件,详细演示了如何快速搭建一阶RC电路并进行仿真分析。文章提供了从元件选取、电路连接、虚拟示波器设置到波形观测的完整流程,并重点分享了测量时间常数、区分电路响应类型等核心分析技巧,帮助电子工程初学者和爱好者高效掌握电路仿真与分析方法。

weixin_29175469的博客 196

【转】ajax同步请求与遮罩层的问题

引用文章链接:https://blog.csdn.net/wingzingliu/article/details/88788205 参考链接:https://www.cnblogs.com/caihua0405/p/8193033.html 具体问题,在使用ExtJS时,页面有个ajax请求,请求前需要在页面加上遮罩层,请求结束,取消遮罩,发现一个问题,当ajax同步时,遮罩层不生效,只...

wsdhla的专栏 2196

TLSR8258蓝牙Mesh实战:从SDK下载到自定义通信指令全流程(附避坑指南)

本文详细介绍了TLSR8258蓝牙Mesh开发的完整流程,从SDK下载、环境搭建到自定义通信指令的实现。通过实战案例和避坑指南,帮助开发者快速掌握低功耗蓝牙Mesh网络构建技巧,适用于智能家居、工业监控等物联网场景。

weixin_29176179的博客 210

js 遮罩层

//调用方法//关闭事件<button onclick='LayerHide()'>关闭</button>,在loadDiv(text)中,剔除出来//调用LayerShow(text),text为参数,可以写入想要写入的提示语//本方法在调用时会自动生成一个添加到body的div,并且会在调用隐藏遮罩层 LayerHide()时删除div//封装遮罩层div显示效果//将...

weixin_30362083的博客 93

FPGA实现的AES加解密算法——Verilog源代码详解

本文将介绍基于FPGA的AES加解密算法的Verilog实现,并提供相应的源代码。根据密钥长度的不同,AES算法分为AES-128、AES-192和AES-256三种模式。对于已知的明文-密钥组合,可以使用在线的AES加解密工具计算出正确的密文,然后将该密文与FPGA加速器的输出进行比较。本文以AES-128算法为例,介绍基于FPGA的AES加解密算法的设计思路和Verilog实现。以上是基于FPGA的AES加解密算法的Verilog实现的相关内容。模块接受输入的明文和密钥,并输出加密后的密文。

HackSquad的博客 1987

逆向工具:一文讲述 Ghidra 的详细使用

Ghidra是由NSA开源的一款功能强大的逆向工程框架,支持多平台、多架构和多种文件格式分析。本文详细介绍了Ghidra的核心优势、安装配置方法、主界面功能模块,并通过一个CrackMe示例演示了完整的逆向分析流程。文章还讲解了高级功能如交叉引用、控制流图分析、数据类型重建和脚本自动化等,最后提供了常见文件格式的分析技巧。作为IDA Pro的免费替代方案,Ghidra适合个人学习、教学和中小项目使用。(149字)

数据知道的博客 4404

js 遮罩层 loading 效果

//调用方法 //关闭事件<button onclick='LayerHide()'>关闭</button>,在loadDiv(text)中,剔除出来 //调用LayerShow(text),text为参数,可以写入想要写入的提示语 //本方法在调用时会自动生成一个添加到body的div,并且会在调用隐藏遮罩层 LayerHide()时删除div //封装遮罩层di...

weixin_34375251的博客 211

打脸来的太快了,又发现一个Trae的宝藏功能--内置浏览器可以指定机型来显示前端界面

今天给大家分享一个Trae的实用功能,就是SOLO模式下内置浏览器可以指定不同的手机、平板机型来查看前端页面显示效果,我感觉这个功能很棒,忍不住就跟大家分享一下。

cpp加油站的专栏 6576

JS生成遮罩层

// 页面加载时遮罩提示 document.write(''              + ''); document.write('页面正在加载,请稍候……'); function removeLoading() {     var objDiv = document.getElementById("loading");     var objText = documen

dzf203的专栏 846

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

jre9下载 jdk9

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

上一篇: JDBC-DBUtils开源工具类库(简化查询封装数据过程)
下一篇: javascript-黑白反斗棋选关模式
fightingcoder419
博客等级 码龄10年 23粉丝 77原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址