我按以下顺序隐藏和显示模态:
当我点击导入按钮时,它将以模态为目标,id="import-actionpopup"然后我有另外两个按钮附加,并在我上传文件和选择选项时覆盖,然后这个import-actionpopup将被关闭,然后我有另外两个模态,id="warningOverrideAction"它们将在overrideButton上打开按钮单击和其他模态id="appendAction"将在appendButton单击时打开。
现在,当我隐藏我的 warningOverrideAction 或 appendAction 模式时,它会自动添加 padding-right:17px; 到我的身体。
当我在 stackoverflow 上搜索时,我发现这是bootstrap.css 中的一个小故障,但我的问题是即使在模态隐藏后填充仍然存在。
$(document).ready(function(){
$("#appendButton,#overrideButton").click(function(event){
path=document.getElementById("zapper").value;
if(path){
if($('#hinkSelect option:selected').prop('disabled') == true){
$('#reportError').modal('show');
document.getElementById('uploadError').innerHTML="<center>You have not selected any tool. <br>Make sure to select one tool.</center>";
document.getElementById('error_title').innerHTML="File Upload Error";
}
else{
toolName=document.getElementById('hinkSelect').value;
$('#import-actionpopup').modal('hide');
if(event.target.id==='overrideButton')
$('#warningOverrideAction').modal('show');
else if(event.target.id==='appendButton')
$('#appendAction').modal('show');
document.getElementById('hinkSelect').value='';
}
}
else{
$('#reportError').modal('show');
document.getElementById('uploadError').innerHTML="<center>You have not uploaded a zip file. <br>Make sure to upload …Run Code Online (Sandbox Code Playgroud)