- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
问题:
页面上的表格在需要时会溢出。
当我按下“ Assets ”和“添加 Assets ”时,会出现一个模式,我可以在其中添加“ Assets ”。除了表格的滚动条之外,模态与正文上的所有元素重叠。
正如您在输入“GPS 跟踪器 ID”的图像上看到的那样,有一个滚动条。
我正在使用 Materialize modals和 Materialize Table对于这个元素。
问题:
我怎样才能重叠滚动条?
代码:
function openForm() {
document.getElementById("myForm").style.display = "block";
}
function closeForm() {
document.getElementById("myForm").style.display = "none";
}
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.modal');
var instances = M.Modal.init(elems);
});
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.dropdown-trigger');
// var options =
var instances = M.Dropdown.init(elems, {coverTrigger: false});
});
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}
html, body {
margin: 0;
height: 100%;
}
#map{
height:100%;
width: 100%;
}
nav{
background-color:#1A9988 !important;
}
/* Button used to open the contact form - fixed at the bottom of the page */
.open-button {
position: absolute !important;
bottom: 23px;
right: 20px;
width: 200px;
}
#form_btn{
float: none;
clear: both;
}
/* The popup form - hidden by default */
.form-popup {
display: none;
position: fixed;
bottom: 0;
right: 15px;
border: 3px solid #f1f1f1;
z-index: 9;
margin-bottom: 0 !important;
}
/* Add styles to the form container */
.form-popup{
max-width: 400px;
min-width: 300px;
width: 25%;
}
/*form box*/
.form-container {
padding: 20px !important;
background-color: white;
}
.login{
color: #1A9988;
display: inline;
font-size: 30px;
}
.Sign-up, .Sign-up:visited{
cursor: pointer;
font-size: 24px;
color: #1A9988;
text-decoration: underline;
float: none !important;
clear: both;
}
#form_full{
background-color: white;
width: 100%;
height: 60%;
position: absolute;
top: 20%;
left: 20%;
opacity: 0.9;
}
#Sign-up{
font-size: 25px;
text-transform: capitalize;
height: 50px;
width: 10%;
position: absolute;
right: 50%;
border-radius: 10px;
}
.not-a-user{
font-size: 24px;
color: #707070;
}
.Cancel{
font-size: 35px;
color: #707070;
}
.Sign-up_Cancel{
font-size: 35px;
color: #1A9988;
text-decoration: underline;
}
#row_link{
margin-left: 0;
}
.alert {
position: absolute;
width: 100%;
top: 5%;
padding: 15px;
background-color: #f44336;
color: white;
text-align: center;
}
.closebtn {
margin-left: 15px;
color: white;
font-weight: bold;
float: right;
font-size: 22px;
line-height: 20px;
cursor: pointer;
transition: 0.3s;
}
.closebtn:hover {
color: black;
}
#login_alert{
top: 0;
}
/*table with gps trackers*/
.Assets{
width: calc(100% - 100px);
margin: 0px 50px 0px 50px;
}
.link{
color: #1a9988;
}
.link:hover{
color: #0f7567;
}
/*popup add assets style*/
/* The Modal (background) */
.add_assets {
left: 0;
top: 10%;
width: 100%; /* Full width */
height: 55%; /* Full height */
overflow: auto; /* Enable scroll if needed */
}
#submit{
font-size: 25px;
text-transform: capitalize;
height: 50px;
width: 20%;
position: absolute;
right:30px;
border-radius: 10px;
}
#Cancel_add{
font-size: 25px;
text-transform: capitalize;
height: 50px;
width: 20%;
position: absolute;
left:30px;
border-radius: 10px;
background-color: #f44336;
}
.animate {
-webkit-animation: animatezoom 5s;
animation: animatezoom 5s
background-color: #fefefe;
}
@-webkit-keyframes animatezoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes animatezoom {
from {transform: scale(0)}
to {transform: scale(1)}
}
@media only screen and (max-width: 600px) {
.Assets::-webkit-scrollbar {
z-index:10;
}
/*asset table*/
.Assets{
width: 100%;
margin: 0px 0px 0px 0px;
}
/*add asset popup style*/
.add_assets {
left: 0;
top: 10%;
width: 100%; /* Full width */
height: 80%; /* Full height */
overflow: auto; /* Enable scroll if needed */
}
#submit, #Cancel_add{
width: auto;
}
.modal-content{
padding: 0;
}
#form_full{
width: 100%;
left: 0;
}
#Sign-up{
width: 50%;
right: 10px;
}
.Cancel{
margin-left: 10px;
}
#e-mail, #password, #name , #GPS_ID, #info{
width: 100%;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" rel="stylesheet"/>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" type="text/css" href="./css/style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="./css/materialize.min.css" media="screen,projection"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Home</title>
</head>
<!-- Dropdown Structure -->
<ul id="dropdown1" class="dropdown-content">
<li><a class="modal-trigger" href="#modal1">Add asset</a></li>
</ul>
<nav>
<div class="nav-wrapper">
<ul id="nav-mobile" class="right">
<li class="active"><a class="dropdown-trigger" href="#!" data-target="dropdown1">Assets<i class="material-icons right">arrow_drop_down</i></a></li>
<li><a href="?logout=1">Uitloggen</a></li>
</ul>
</div>
</nav>
<body>
<table class='Assets responsive-table centered highlight'>
<thead>
<tr>
<th>Asset name</th>
<th>GPS_ID</th>
<th>Info</th>
<th>Actions</th>
</tr>
</thead>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<!-- add asset form -->
<div id="modal1" class="modal add_assets modal2">
<div class="modal-content">
<h4>Voeg asset toe</h4>
<form class="col s12 animate" action="" method="post">
<div class="row">
<div class="input-field col s12" id="name">
<input class="validate" type="text" required name="name">
<label for="Name">Asset name</label>
<span class="helper-text" data-error="Veld mag niet leeg zijn" data-success="correct">Geef de GPS tracker een naam</span>
</div>
<div class="row">
<div class="input-field col s12" id="GPS_ID">
<input class="validate" type="number" required name="GPS_ID">
<label for="GPS_ID">GPS tracker ID</label>
<span class="helper-text" data-error="Moet een nummer zijn" data-success="correct">Example: 32043123</span>
</div>
</div>
<div class="row">
<div class="input-field col s12" id="info">
<input class="validate" type="text" required name="info">
<label for="Info">Other gps info</label>
<span data-error="Veld mag niet leeg zijn" data-success="correct" class="helper-text">Extra info over de GPS</span>
</div>
</div>
<div class="input-group">
<button id="submit" class="btn waves-effect waves-light" type="submit" name="submit">Add</button>
</div>
<button id="Cancel_add" type="button" class="btn waves-effect waves-light modal-close" >Cancel</button>
</div>
</form>
</div>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</html>
最佳答案
首先非常感谢@Awais为了帮助。
解决方法:
显然,滚动条仅在您在 Firefox 中模拟移动少数时才显示。
当我将代码放在托管上并使用 Firefox 浏览器在我的手机上访问网站时。没有滚动条。
关于html - 模态不重叠滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60430629/
是否有更快的算法来计算 (n! modulo m)。在每个乘法步骤都比减少更快。并且有没有比左右二元法更快的算法来计算 (a^p modulo m)。 这是我的代码:n!模数m ans=1 for(i
我有非常简单的代码循环遍历数组中的元素并检查是否index % 2 == 0。如果是这样,它应该改变颜色。 var e = document.getElementById("list").childN
让我简短一点。我正在计算 alert((Math.pow(7,35))%71) 但它给了我 61,而结果必须是 70。怎么了? 最佳答案 正如其他人之前提到的关于使用 Math.pow(7,35) 的
我试图弄清楚如何在汇编中计算模 10,所以我在 gcc 中编译了以下 c 代码,看看它想出了什么。 unsigned int i=999; unsigned int j=i%10; 令我惊讶的是我得到
例如使用以下输入: int num = -100 int divisor = 10 => -100 mod 10 = 0 (Edge-case: negative numbers as inpu
这个问题在这里已经有了答案: Random float number generation (14 个答案) 关闭 9 年前。 在 C++ 中,我希望得到一个随机 float 。据我所知,典型的随机
我试图找到潜在阶乘素数的除数(n!+-1 形式的数),因为我最近购买了 Skylake-X 工作站,我认为我可以使用 AVX512 指令提高一些速度。 算法简单,主要步骤是对同一个除数重复取模。主要是
我有一个保存角度(以度为单位)的变量,该角度可以是正值也可以是负值。我现在需要确保该数字仅在 0 到 360 之间。该数字是 double 。 执行此操作的好算法是什么?简单地执行角度 % 360 是
我有一个 UInt8 数组,我想计算 CheckSum8 模 256。如果字节总和小于 255,checkSum 函数返回正确的值。 例如 let bytes1 : [UInt8] = [1, 0xa
使用海湾合作委员会: printf("%i \n", -1 % (int)4); printf("%u \n", -1 % (unsigned int)4); 输出: -1 3 我可以跨平台依赖这种行
我无法理解代码中几行的含义。我最近开始学习 C++,并阅读了 Bjarne Stroustrup 的“编程:使用 C++ 的原理和实践”。第四章有个问题让我很困惑,所以我在网上搜索了一个解决方案以供引
我试图解决一个涉及大阶乘模质数的问题,并在另一个人的解决方案中发现了以下算法: long long factMod (long long n, long long p) { long long
我正在尝试计算 𝐹𝑛 模 𝑚,其中 𝑛 可能非常大:高达 10^18,𝐹𝑛 是第 n 个斐波那契数这是我的代码,它适用于小数字,但对于大数字,它会抛出 OutOfMemoryError 或
我有两个以 16 为模的循环整数,因此它们的值介于 0 和 15 之间。 我需要比较两个数字以确定 n_1 是否大于 n_0 n_1 > n_0 很明显,这个没有准确定义,所以我定义n_1如果小于前面
我一直在尝试使用 Java 处理一些更大的值,但遇到了一些我不理解的问题。出于某种原因,Java 似乎喜欢给我垃圾数据(尽管,我更可能告诉它给我垃圾数据) 这是一个片段,为清楚起见进行了编辑:
好吧,我今天做了一个小函数,它应该会生成一个随机字符串。 std::string randString(size_t length) { std::string randStr; fo
Ruby 的负数取模规则不明确。在 IRB 中: -7 % 3 == 2 应该是1!为什么? 最佳答案 因为 -7/3 在 Ruby 的整数除法语义下是 -3。 3*-3 是 -9,所以会留下 2
这个问题在这里已经有了答案: Calculating pow(a,b) mod n (14 个答案) 关闭 6 年前。 在 Javascript 中是否有获取大数模数的技巧。我用 modulo(7,
此代码使用公式 (a^x) % 101 检查值 a 是否唯一映射到值 1 到 100 local function f(a) found = {} bijective = true
在《Core Java Volume1》一书中有一条警告: CAUTION: The right-hand side argument of the shift operators is reduce
我是一名优秀的程序员,十分优秀!