gpt4 book ai didi

jquery - 如何增加弹出窗口的宽度

转载 作者:行者123 更新时间:2023-12-01 04:33:22 25 4
gpt4 key购买 nike

$(document).ready(function(){
$('#autodelete_spmlds').popover({
placement: 'bottom',
title: '<span style="color:black;font-size: 12px;font-family:Open Sans,Helvetica Neue,Helvetica,Arial,sans-serif">Settings</span>' + ('&nbsp;') + ('&nbsp;') + '<button type="button" class="close pull-right" data-dismiss="alert" style="color:black;">&times;</button>',
html: true,
content: function () {
return $('#autodelete').html();
}
});

$(document).on("click", ".popover .close" , function(){
$(this).parents(".popover").popover('hide');

});
});



<div class='hide' id='autodelete'>
<form class="form-bordered" action="<?=base_url()?>approval/update_selectedspmlds" id="spm_options" name="" method="post" >
<div class="panel-group">
<div class="panel panel-default">
<label>Delete After</label>
<select class="form-control" id="spm" name="spm" required>
<option value=""> Delete Leads automatically </option>
<option value="7">1 Week Older</option>
<option value="30">1 Month</option>
<option value="60">2 Month</option>
</select>
</div>
<br/>
<div class="popover-footer">
<input type="submit" id="smtbtn" class="btn btn-info btn-sm" value="Save">
</div>
</div>
</form>
</div>

这里我需要在同一行中给出“删除后”和选择具有相同宽度的框,但我已经尝试过它不会出现。我不知道为什么。请任何人帮助我。

最佳答案

只需为弹出窗口编写自定义 CSS。

参见下面的示例

$(document).ready(function(){
$('.btn-success').popover({
title: "Header",
content: "Blabla",
placement: "bottom"
});
});
.popover {
width:200px
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
<h3>Popover Options</h3>
<p>The <strong>placement</strong> option specifies the popover position.</p>
<div>
<button class="btn btn-success btn-md">Bottom</button>
</div>
</div>


</body>
</html>

如果您可以为该 CSS 进行嵌套,那么请这样做。否则,它将应用于所有弹出窗口。

关于jquery - 如何增加弹出窗口的宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60756899/

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