小程序自定义弹出层禁止页面滚动

微信小程序之开发遇到 does not have a method “xxxx“ to handle event “tap“ 问题的解决方案【已解决】 在配置中找不到方法,所以在点击响应时,会有警告,但是程序运行不会报错。这也是小白在学习小程序时经常容易犯的错误,今天竟然把一个开发了多个小程序的我给呆住了,现在就来分析一下产生这个问题的原因有哪些。 阅读详情

catchtouchmove 在小程序模拟器中没有效果,真机测试时可以

使用catchtouchmove=“true”,会一直弹出警告错误“does not have a method “true” to handle event “touchmove”,所以这里定义个方法

<block wx:if="{{showVideo == true}}">
  <view class="showVideoBg" catchtouchmove="filterViewMove">
        <view>
        <video 
          id="myVideo" 
          src="video_url" 
          binderror="videoErrorCallback" 
          show-center-play-btn='true' 
          show-play-btn="true" 
          autoplay="true"
          object-fit="cover"
          controls
          enable-play-gesture="{{true}}"
          bindended="closeVideo"
        ></video>
        <image src="/images/close.png" class="close_video" bindtap="closeVideo"></image>
      </view>
  </view>
</block>

.showVideoBg{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: black;
}
.showVideoBg view{
  width: 100%;
  height: 100%;
  position: relative;
}
.showVideoBg scroll-view{
  width: 100%;
  height: 100%;
}
.showVideoBg video{
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
}
.close_video{
  position: absolute;
  top: 100rpx;
  right: 30rpx;
  width: 60rpx;
  height: 60rpx !important;
}

js

// 定义页面禁止滚动
  filterViewMove: function(){
    return;
  },
C# ArcGIS Engine二次开发——实现“加载shp文件” private void AddShpDataToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog OpFileDialog=new OpenFileDialog();//OpenFileDialog:打开文件对话框 OpFileDialog.Title="添加矢量数据"; OpFileDialog.Filter="(*.shp)|*.shp";//filter:过滤器;"(*.shp)|*.shp" 阅读详情

相关推荐

Pycharm环境配置完整教程

本文主要介绍python解释器安装、Pycharm环境配置以及运行第一个程序的零基础的教程,即使是python小白也能正确配置相应的python学习环境哦!

悠眠小虫的博客 2万+

弹窗弹出后,事件穿透问题

弹窗弹出后,事件穿透引起图片错位问题 在写一个uniapp的页面时,弹窗弹出后底层盒子还能进行拖动,从而引起图片错位问题, 解决 在弹出的盒子上设置catchtouchmove事件, <view catchtouchmove>这是弹出层</view> 但是只设置一个事件会报错: does not have a method “true” to handle event “...

dujyong的博客 2147

Linux命令行入门:从零掌握服务器运维与Shell脚本基础

在信息化时代,操作系统是数字世界的基石,而终端命令行则是高效驾驭服务器的核心技能。无论是软件部署、服务监控还是故障排查,掌握基于Shell的指令操作都能大幅提升工程效率。从最基础的文件目录管理、文本处理,到权限控制、进程监控与网络调试,命令行提供了一套强大且可自动化的操作范式。尤其对于运维工程师和开发者而言,理解管道、重定向以及脚本化任务,意味着将重复劳动转化为可复用的自动化流程。本文从环境准备讲起,系统梳理常用Linux命令的实际场景与输出验证,并延伸至Shell脚本编写与定时任务,帮助初学者快速建立从操

weixin_30522983的博客 255

微信小程序遇到的手指触摸问题

手指触摸问题

qq_43271846的博客 1151

[TI板]MSPM0G3507——keil环境配置+烧录配置+vscode配置+空工程迁移+点灯+芯片解锁教程

本文介绍了MSPM0G3507开发环境的配置与烧录方法。主要内容包括:1)下载安装芯片支持包和SDK开发工具;2)通过串口或DAPLink两种方式实现程序烧录,详细说明了UniFlash软件的使用步骤和常见问题解决方法;3)简要提及工程迁移和LED点灯等基础操作。文章提供了完整的开发环境搭建指南,涵盖从软件安装到实际烧录的全过程,并附有相关工具下载链接和操作截图,帮助开发者快速上手MSPM0G3507开发。

qq_23220445的博客 1万+

stackelberg博弈_博弈论、多智能体、强化学习(随便记点东西)

多智能体应用场景:已实现:游戏AI。正在努力:UAV,物资运输,快递分发,交通系统。未来:社会学,预测群体行为,城市区域合作,国际关系。博弈论基本定义:玩家集合: 策略集合: 收益函数: 囚徒困境:两智能体矩阵博弈坦白抵赖坦白1,13,0抵赖0,32,2占优策略与最佳应对:上表中两者均具有占优策略,即无论如何都应该选坦白。那么构造下表。坦白抵赖坦白1,13,0抵赖0,12,2对于玩家一来说,坦白...

weixin_39611722的博客 2997

微信小程序,uni-app阻止滚动事件或悬浮按钮拖动事件穿透(事件穿透)

微信小程序,uni-app阻止滚动事件或悬浮按钮拖动事件穿透(事件穿透) 阻止滚动事件穿透的应用场景 **【场景一】**在开发中遇到这样一个需求,在页面中添加一个仿苹果的拖动悬浮按钮,但是在长页面中,当拖动悬浮按钮时,长页面也会随之滚动。因此需要组织悬浮按钮上的touchmove事件穿透。 **【场景二】**有时候我们需要在页面中弹出一个弹窗,在弹窗弹出后需要禁止原页面继续滚动。 阻止滚动事件穿透...

云间月 1万+

windows10家庭版输入loadrunner注册码时报“License security violation. Operation isnot allowed”的解决办法

有可能出现2个错误第一个可能是第二个可能是“License security violation. Operation isnot allowed”ok,在此我在百度找了很多方法,大部分的方法都是删除注册表,但我根本就找不到这个注册表,而后又是管理中心找本地用户和组,但我依旧找不到这个玩意,然后可能是windows10家庭版本来就没有这个。再然后又以管理员身份去运行填写,好的,依旧报错,依旧未解决...

qq_30990097的博客 2558

does not have a method “xxx“ to handle event “tap“报错

初始化小程序模板,添加自定义点击事件,有does not have a method "xxx" to handle event "tap"提示: 1:js未定义该事件,查看是否已定义该事件 2:查看app.json是否有lazyCodeLoading属性,删除"lazyCodeLoading":"requiredComponents"该属性(类似什么修改本地设置之类的处理办法,时无法真正处理该问题) ...

new_rike的博客 6749

使用Python实现深度学习模型:智能极端天气事件预测

在本项目中,我们成功利用Python和Keras库构建了一个基于LSTM的极端天气预测模型。通过时间序列数据,模型能够识别天气趋势并预测未来的极端天气事件。尽管这是一个简化的示例,但它为实际应用中如何利用深度学习进行天气预测提供了一个很好的基础。随着更精确的数据和更多的特征信息,类似的模型可以进一步扩展到其他极端事件预测上,如风暴预警、气象灾害评估等。

Echo_Wish 730

云计算 | 期末梳理(上)

2024云计算回忆版 && 复盘向梳理

知识库搭建ing 2231

小程序弹出层禁止列表滑动_小程序自定义弹层禁止页面滚动方案详解

方案一:通过小程序自定义组件scroll-view实现布局,动态修改scroll-y属性缺点:布局局限于scroll-view组件,大部分需求都满足不了方案二: 自定义弹层蒙层或者外层容器添加catchtouchmove事件```js弹层内容```缺点:弹层滑动不了;适用于自定义弹层不滑动的布局方案三:动态添加给最外层元素添加position:fixed样式```js内容区```缺点:当isMas...

weixin_39802519的博客 497

uni-app - 最详细 H5 网页接入微信登录功能,提供公众号配置与详细注释示例代码(移动端网页实现点击登录按钮后 调用微信公众号授权登录功能 详细讲解接入流程与详细示例代码)官方最新超级详细教程

uniapp中H5微信登录,uniapp H5微信授权登录,微信公众号第三方网页(H5)授权登录(OAuth2.0)流程及逻辑详细教程,UNIAPP 开发H5 怎么实现微信公众号登录功能,uniapp如何实现H5网页的公众号微信登录,怎么做uniapp微信登录,uniapp h5项目怎么实现微信登录的功能,uniapp微信浏览器H5授权微信登录,UniApp开发H5接入微信登录的全过程,uniapp的H5页面使用微信登录,uniapp H5微信授权登录,H5之微信授权登陆 (uniapp网页版微信授权登录)

🏆 前端领域优质创作者 7409

小程序弹出层禁止列表滑动_小程序解决自定义弹出层滑动时下层页面滚动问题--穿透问题...

一、问题描述小程序自带弹框满足不了某些需求,为此则需要设置自定义弹框,但是问题来了,在滑动弹层的时候,弹层页面会随着弹层底部的滚动条滚动二、解决办法在弹出层加上 catchtouchmove 事件- 如果弹层里的内容需要滚动则需要使用scroll-view组件原理:弹窗元素设置catchtouchmove="true"目的是为了阻止弹窗滚动的时候 会带动外层页面的滚动,但是如果弹窗元素设置了该属性...

weixin_36304957的博客 483

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

小程序弹出层禁止列表滑动_微信小程序解决自定义弹出层滑动时下层页面滚动问题...

弹出 fixed 弹窗后,在弹窗上滑动会导致下层的页面一起跟着滚动。场景一:弹窗内无滚动内容可以在弹窗最外层元素绑定touchmove事件,触发事件返回false即(在vue类框架中也可以加.stop阻止冒泡)。简单写法:catchtouchmove='preventTouchMove',在js文件中定义一个方法preventTouchMove() { return } 即可。此种方式会阻止弹窗内...

weixin_36023192的博客 1186

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

微信小程序弹出层弹出后禁止页面滚动

微信小程序弹出层禁止页面滚动

灰灰的博客 1961

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

小程序显示弹窗时禁止下层的内容滚动

用 catchtouchmove=“return” //此处为弹窗内容 <view catchtouchmove="return"> //外层加 catchtouchmove="return"仅触摸背景区域时不穿透底部. <view catchtouchmove="return"></view> //在每个小的区域内加 catchtouchmove=...

岁末zzz的博客 870

小程序 弹出层 禁止页面滚动

添加自定义的弹出框后,当滚动鼠标时下边的页面也会跟着滚动 解决办法: 在弹出层上添加 catchtouchmove=’true’ &lt;!--弹出框 --&gt; &lt;view class="sh_Model_box" catchtouchmove='true'&gt; ... &lt;/view&gt; 注意:开发工具的模拟器上没有效果,必须真机测试,真机上有效果...

Nina_xy123的博客 4658

uniapp弹出层使用scroll-view进行内容滚动+锚点定位滑动到最底部,解决弹出层滚动穿透

uniapp弹出层使用scroll-view内容滚动+锚点定位,解决弹出层滚动穿透

qq_43958325的博客 2万+

微信小程序弹出层禁止滚动穿透

uniapp实现微信小程序中禁止滚动穿透、打开弹出层禁止底部页面滚动

sxy323的博客 1771

微信小程序 弹出层 禁止页面滚动的方法

场景描述 添加自定义的弹出框后,当滚动鼠标时下边的页面也会跟着滚动。 解决方案 为了在遮罩出现的时候禁止用户滑动页面,如下处理: 给这个遮罩层 绑定事件: 使用 catchtouchmove (1)在弹出层上添加 catchtouchmove=’true’ <!--弹出框 --> <view class="sh_Model_box" catchtouchmove='true'> ... </view> (2)也可以绑定有一个空事件 <view cat

sinat_33255495的博客 4097

[微信小程序] 弹出遮罩层后禁止背景层滚动的办法

先定义一个overflow:hidden的全局样式,然后在点击出现遮罩层之后让最底层的使用这个样式即可,class上可以绑定一个变量,动态赋值样式的名称,例如: app.wxss 代码片段 .disableScroll { position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100%; overflow: hidden; } index.wxml 代码片段 <view class="{{ scrollStyle

我的米饭 1817

微信小程序 弹出层禁止页面滚动

微信小程序 vant 中 所有弹出层都会有的一个问题 滑动弹出层 会出现页面也滚动 如下图 解决方法: 1、首先在最外围的类中加入overflow: hidden; 2、当弹出层出现的时候 给最外围的view 加入root-fixed 类 隐藏的时候 去掉root-fixed <view class="root {{isScroll?'root-fixed':''}}"></view> isScroll 控制是否绑定root-fixed 这个类 .root {

IT_iosers的博客 1393

弹出遮罩层后,如何禁止底层页面的滚动

本文转载于:猿2048网站https://www.mk2048.com/blog/blog.php?id=10c21j&title=%E5%BC%B9%E5%87%BA%E9%81%AE%E7%BD%A9%E5%B1%82%E5%90%8E%EF%BC%8C%E5%A6%82%E4%B...

898

uniapp小程序禁止遮罩弹窗下的页面滚动的完美解决办法

问题 最近用uniapp开发一款APP,页面是可以滚动的长列表,自定义组件弹窗遮罩出来后,滑动屏幕底部还在滚动,研究了网上的解决办法: 在最外层的view中加入@touchmove.stop.prevent="moveHandle" 在最外层的view中加入@catchtouchmove="moveHandle" 我测试了一下这两个事件方法发现不太理想,会导致弹窗和底部页面都不能滚动了,或者处理不当就报一些其他错误,还是不太简便。 解决 又看了一下微信小程序官方技术给的介绍,其实这事浏览器的滚动穿透问题

红星的专栏 1万+
上一篇: tp5+mysql写入特殊表情符号数据时失败
下一篇: 微信小程序视频自动全屏
if时光重来
博客等级 码龄8年 248粉丝 217原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值