Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
317 views
in Technique[技术] by (71.8m points)

javascript - SweetAlert lift the content and not make it stack

I have some problem in here, and I first time using alert in the sweet alert, I have a question about this topic why when I call my alert the content is up to lift and not stack with the alert? For the example like this :

enter image description here

I am confused about this, well I already follow the documentation to use this alert, and I didn't change anything for this style, I just call the javascript, and for the result like the image above.

js

let Swal = require('sweetalert2');
$(document).ready(function () {
   "use strict"
   $("#my-button").on('click', function () {
      Swal.fire(
           'The Internet?',
           'That thing is still around?',
           'question'
      )
   });
});

html

 <button type="submit" id="my-button" class="btn btn-block btn-primary">Sign In</button>

Swal.fire(
  'The Internet?',
  'That thing is still around?',
  'question'
)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.css">
question from:https://stackoverflow.com/questions/65881347/sweetalert-lift-the-content-and-not-make-it-stack

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can add some style based on sweetAlert2's classes.
Checkout this documentation: Theming


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...