【发布时间】:2020-04-12 17:25:45
【问题描述】:
我在 sweetalert2 中尝试了 target opt,但 toast 仍然出现在 target 之外
我做错了什么?
这是代码
#trial {
position: absolute;
display: block;
height:200px;
width: 500px;
border: 1px solid;
}
<div id="trial"></div>
<script>
$(document).ready(function() {
var id = document.getElementById('trial');
Swal.fire({
title: 'I will be placed inside the #swal2-container',
toast: true,
target: id,
position: 'bottom-left'
});
});
</script>
结果如下:
【问题讨论】:
标签: javascript css sweetalert sweetalert2