jq 修改swal的标题_jquery SweetAlert插件实现响应式提示框

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

先给大家演示效果:

代码如下:

Sweet Alert

A beautiful replacement for JavaScript's "Alert"

Download

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

Show error message

Code:
alert("Oops... Something went wrong!");
Sweet Alert

Show error message

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

    Try me!

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

    Try me!

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

    Try me!

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

    Try me!

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值