gpt4 book ai didi

javascript - 即使已初始化,Materialize Slider 无法工作也会显示灰屏

转载 作者:行者123 更新时间:2023-11-28 05:45:54 26 4
gpt4 key购买 nike

正如标题所说,我在本地访问materialize css和js,从那里下载,如果我清除了缓存和cookie,那么我会从materialize.min.js中收到此错误,如下所示 picture here (click)

这是我的 html 和 js 代码。

$(document).ready(function(){
$('.slider').slider({full_width: true});

$('#btnLogin').click(function(){
postOrderID();
});
$('#loginPanel').click(function(){
$('#modalLogin').openModal();
})


function postOrderID() {
var _pass = document.getElementById("txtPayment").value;
var dataString = 'tablepass=' + _pass; //+ '&name=' + _name + '&pax=' + _pax + '&pass=' + _pass;
if (_pass == '') {
alert("Textbox null");
} else {
$.ajax({
type: "POST",
url: "php/getinsertOR.php",
data: dataString,
}).done(function(data){
console.log(data);
if (data == 'Success') {
window.location.replace("index.html");
}else if (data == 'Failed'){
alert("Wrong Password")
}else if (data == 'Damage'){
alert("Table Damaged")
}else{
window.location.replace("index.html");
}
}).fail(function(){

})
}
return false;
}

});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link type="text/css" rel="stylesheet" href="materialize/css/materialize.min.css" media="screen,projection"/>
</head>
<body>
<div class="slider fullscreen">
<ul class="slides">
<li>
<img src="images/a3.jpg"><!-- random image -->
<div class="caption center-align">
<h3>This is our big Tagline!</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
<a id="loginPanel" class="waves-effect waves-light btn modal-trigger">Login</a>
</div>
</li>
<li>
<img src="images/a2.jpg"> <!-- random image -->
<div class="caption left-align">
<h3>Left Aligned Caption</h3>
<h5 class="light grey-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
<li>
<img src="images/a1.jpg"><!-- random image -->
<div class="caption right-align">
<h3 class="light black-text text-lighten-1">Right Aligned Caption</h3>
<h5 class="light black-text text-lighten-3">Here's our small slogan.</h5>
</div>
</li>
</ul>

</div>

<!-- Modal Structure -->
<div id="modalLogin" class="modal container">
<div class="modal-content" style="text-align: center; padding-left: 20% ; padding-right: 20%">
<label>Note: Confirmation Key is located at the table</label>
<input id="txtPayment" type="text" id="tablepass" name="tablepass" placeholder="Enter Confirmation Key" style="text-align: center"> <br>
<a id="btnLogin" class="waves-effect waves-light btn modal-trigger">Submit</a>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="materialize/js/materialize.min.js"></script>
<script src="js/loginController.js"></script>
</body>

</html>

最佳答案

兄弟,它在我的电脑上运行得很好。只需检查您是否在 mozilla firefox 中禁用 javascript 或使用其他浏览器运行该页面即可。一定会成功的。

要为 Mozilla Firefox 启用 JavaScript:单击“工具”下拉菜单并选择“选项”。选中“阻止弹出窗口”、“自动加载图像”和“启用 JavaScript”旁边的框。通过右键单击页面上的任意位置并选择“重新加载”或使用工具栏中的“重新加载”按钮来刷新浏览器。

关于javascript - 即使已初始化,Materialize Slider 无法工作也会显示灰屏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38528893/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com