当前位置:网站首页>微信小程序 webview 禁止页面滚动,同时又不影响业务内overflow的滚动的实现方式
微信小程序 webview 禁止页面滚动,同时又不影响业务内overflow的滚动的实现方式
2022-07-01 09:08:00 【你的长情呢~】
html,body{
position: fixed;
top:0;
left:0;
height: 100vh;
overflow: scroll;
}
实现方式超级简单,但是我调了好多次都没有实现效果,研究了半天发现是页面缓存的问题,于是在head标签内加载css文件的时候改成了以下写法
<link type="text/css" rel="stylesheet" href="css/page.css?t=<?=filemtime("css/style.css")?>">
====================================
2020年6月28日 16:03:03 修改
上面的做法或许是可以实现的,但是在某些情况下导致业务内的滑动也失效。今天又研究了一套做法就是。
.bg {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
overflow: auto;
background-color: #fff;
}
<script type="text/javascript">
setInterval(function () {
$(".bg").focus();
console.log(1);
}, 500);
</script>
解释一下,我理解的应该也不是完全正确的 就是 css样式可以实现想要的效果,但是偶尔页面上需要滑动的dom会失焦,导致无法滑动,此时可以用js定时器给这个dom元素获取焦点。
边栏推荐
- 【pytorch】2.4 卷积函数 nn.conv2d
- Football and basketball game score live broadcast platform source code /app development and construction project
- 安装Oracle EE
- Structure de l'arbre - - - arbre binaire 2 traversée non récursive
- 类加载
- MySQL optimization
- Flink面试题
- Shell脚本-字符串
- Shell script case in and regular expressions
- LogBack
猜你喜欢

2.4 activation function

2.4 激活函数
![2.3 [pytorch] data preprocessing torchvision datasets. ImageFolder](/img/19/cce8d8a7cdcb1021166c46adf803c1.png)
2.3 [pytorch] data preprocessing torchvision datasets. ImageFolder

Personal decoration notes

Preparing for the Blue Bridge Cup -- bit operation

Redis -- lattice connects to redis cluster

Structure de l'arbre - - - arbre binaire 2 traversée non récursive

小鸟识别APP

I use flask to write the website "one"

2.2 【pytorch】torchvision.transforms
随机推荐
It technology ebook collection
pcl_ Viewer command
Software Engineer Interview Question brushing website and experience method
tensorrt yolov5_ trt. Py comments
[video game training] real topic of 2013 video game of infrared optical communication device
Imitation of Baidu search results top navigation bar effect
美团2022年机试
Which method is good for the management of fixed assets of small and medium-sized enterprises?
【ESP 保姆级教程 预告】疯狂Node.js服务器篇 ——案例:ESP8266 + MQ系列 + NodeJs本地服务 + MySql存储
2.2 【pytorch】torchvision. transforms
Shell脚本-while循环详解
Personal decoration notes
Is it safe to dig up money and make new shares
Shell script - array definition and getting array elements
Shell script - definition, assignment and deletion of variables
Can diffusion models be regarded as an autoencoder?
Common interview questions for embedded engineers 2-mcu_ STM32
Shell script - positional parameters (command line parameters)
Summary of reptile knowledge points
LogBack