栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

jquery SweetAlert插件实现响应式提示框

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

jquery SweetAlert插件实现响应式提示框

jquery弹出层插件,支持消息提示、错误提示、确认框提示等。交互体验度非常好,大家都用微信支付、支付宝等完成用户体验度非常的不错。本插件至少要支持IE9+。使用方式也非常的简单、粗暴,很符合大众的jquery插件使用方法。

先给大家演示效果:

在线预览    源码下载

代码如下:

Sweet alert
A beautiful replacement for Javascript's "alert"

So... What does it do?

Here's a comparison of a standard error message. The first one uses the built-in alert-function, while the second is using sweetalert.

Normal alert Code:
alert("Oops... Something went wrong!");
 
Sweet alert Code:
sweetalert("Oops...", "Something went wrong!", "error");

Pretty cool huh? Sweetalert automatically centers itself on the page and looks great no matter if you're using a desktop computer, mobile or tablet. It's even highly customizeable, as you can see below!

More examples

In these examples, we're using the shorthand function swal to call sweetalert.

  • A basic message

    swal("Here's a message!")
  • A title with a text under

    swal("Here's a message!", "It's pretty, isn't it?")
  • A success message!

    swal("Good job!", "You clicked the button!", "success")
  • A warning message, with a function attached to the "/confirm/i"-button...

以上就是本文通过代码给大家详解jquery Sweetalert插件实现响应式提示框,希望对大家有所帮助。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/101103.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号