sweetalert 2 target a div rather than entire window?

前端 未结 1 1571
星月不相逢
星月不相逢 2021-01-25 14:28

Is it possible to target a div rather than the entire window for SweetAlert2?

If not is is possible to edit the center coordinates?

The reason I ask is that I ha

1条回答
  •  情书的邮戳
    2021-01-25 14:40

    Here you go:

    Swal.fire({
      title: 'I will be placed inside the #swal2-container',
      target: document.getElementById('swal2-container')
    })
    
    
    

    SweetAlert2 documentation: https://sweetalert2.github.io/

    0 讨论(0)
提交回复
热议问题