Bootstrap切换按钮似乎拒绝与php一起工作。
<div style="width:100%; height:auto; padding:10px 0; background:#0F71BA; font-family:Verdana; color:#fff;" onclick="toggleDept()">
<span style="margin-left:10px;"> Select Department </span>
<i class="fa-chevron-down fa" style="float:right; margin-right:10px; cursor:pointer"></i>
</div>
<div style="width:100%; background:#fff; height:400px; overflow:auto; display:none" id="dept-sub-list-mobile">
<?php...Click Departments dropdown in mobile mode to understand the issue
发布于 2019-10-17 08:44:49
页面上没有toggleDept javascript函数;请将以下代码添加到javascript文件中
function toggleDept(){
$('#dept-sub-list-mobile').toggle();
}发布于 2019-10-17 14:02:17
在javascript中你可以这样做:
function toggleDept(){
var x = document.getElementById("dept-sub-list-mobile");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}发布于 2019-10-17 16:37:30
你必须在页面上添加toggleDept()函数javascript函数。对于切换功能,我们使用jQuery toggle()方法。代码如下:
function toggleDept(){
$('#dept-sub-list-mobile').toggle();
}https://stackoverflow.com/questions/58423333
复制相似问题