Hiii每个人.
下面是我的HTML.
<!DOCTYPE html>
<html>
<head>
<script src="src/recorder.js"></script>
<script src="src/Fr.voice.js"></script>
<script src="js/jquery.js"></script>
<script src="js/app.js"></script>
</head>
<body>
<div class="center_div">
<span class="recording_label">Please wait...</span>
<span class="loader_bg"></span>
<span class="loader_bg1"></span>
<br/>
<audio controls id="audio"></audio>
</div>
<style>
.center_div {
width: 500px;
height: 150px;
background-color: #f5f5f5;
border: 1px solid #808080;
position:absolute;
top:50%;
left:50%;
margin-left:-250px;/* half width*/
margin-top:-75px;/* half height*/
padding:25px;
}
.recording_label {
display: block;
text-align: center;
padding: 10px;
font-family: sans-serif;
font-size: 1.1em;
margin-bottom: 25px;
}
.loader_bg {
min-width: 100%;
background: #c5c5c5;
min-height: 20px;
display: block;
} …Run Code Online (Sandbox Code Playgroud) 我从后端获取了超过 30000 条记录并在前端列出,因此使用 cdk-virtual-scroll 我可以实现这一目标。我创建了用 cdk-tag 括起来的普通表
<cdk-virtual-scroll-viewport [itemSize] = "20">
<div class="result_table">
<table class="dataframe" border="1">
<thead>
<tr>
<th >
Name
</th>
<th >
Description
</th>
<th >
Group
</th>
<th >
Data
</th>
</tr>
</thead>
<tbody>
<tr *cdkVirtualFor ="let data of address_obj_data_holder | filter:searchAddr">
<td >
{{data.name}}
</td>
<td >
{{data.description}}
</td>
<td >
{{data.group}}
</td>
<td >
{{data.data}}
</td>
</tr>
</tbody>
</table>
</div>
</cdk-virtual-scroll-viewport>
Run Code Online (Sandbox Code Playgroud)
如果我这样做,当我向下滚动时,表格标题也会滚动,如果我喜欢,
<cdk-virtual-scroll-viewport [itemSize] = "20">
<div class="result_table">
<table class="dataframe" border="1">
<thead>
<tr>
<th style="width: …Run Code Online (Sandbox Code Playgroud) 大家好,
下面是我的代码来显示切换按钮是/否。我想要做的是基于用户选择我想检索数据。如果他们选择是切换按钮 javascript 变量应该有是字符串,否则没有字符串。
HTML代码
<label class="switch">
<input class="switch-input" type="checkbox" />
<span class="switch-label" data-on="Yes" data-off="No"></span>
<span class="switch-handle"></span>
</label>
Run Code Online (Sandbox Code Playgroud)
CSS
.switch {
position: relative;
display: block;
vertical-align: top;
width: 100px;
height: 30px;
padding: 3px;
margin: 0 10px 10px 0;
background: linear-gradient(to bottom, #eeeeee, #FFFFFF 25px);
background-image: -webkit-linear-gradient(top, #eeeeee, #FFFFFF 25px);
border-radius: 18px;
box-shadow: inset 0 -1px white, inset 0 1px 1px rgba(0, 0, 0, 0.05);
cursor: pointer;
}
.switch-input {
position: absolute;
top: 0;
left: 0;
opacity: 0;
}
.switch-label { …Run Code Online (Sandbox Code Playgroud)
我尝试使用AJax,Jquery,Laravel上传图像.在这里,我尝试了这么多解决方案,但我得到419错误,在某些情况下得到500内部错误.
我试过的代码是
<form method="POST" id="needs" novalidate enctype="multipart/form-data">
{{csrf_field()}}
<input name="image1" id="image1" type="file" class="form-control" required="" />
<br>
<input type="file" name="image2" id="image2" class="form-control" required/>
<br>
<input type="file" name="image3" id="image3" class="form-control" required/>
<br>
<input type="file" name="image4" id="image4" class="form-control" required/>
<br>
<input type="file" name="image5" id="image5" class="form-control" required />
<br>
<button type="button" id="upload_image" name="upload_image" class="btn btn-lg btn-success" onclick="image_up();">Upload</button>
</form>
Run Code Online (Sandbox Code Playgroud)
jQuery的:
function image_up()
{
alert("Uploading start");
$.ajax({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
url: "{{route('collage.store')}}",
type: 'POST',
data : new FormData($(this)[0]),
dataType: "json",
cache : false,
processData: …Run Code Online (Sandbox Code Playgroud)