jquery SweetAlert插件实现响应式提示框_Javascript教程-查字典教程网
jquery SweetAlert插件实现响应式提示框
jquery SweetAlert插件实现响应式提示框
发布时间:2016-12-30 来源:查字典编辑
摘要:jquery弹出层插件,支持消息提示、错误提示、确认框提示等。交互体验度非常好,大家都用微信支付、支付宝等完成用户体验度非常的不错。本插件至...

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

先给大家演示效果:

在线预览 源码下载

代码如下:

<h1>Sweet Alert</h1> <h2>A beautiful replacement for JavaScript's "Alert"</h2> <button>Download</button> <h3>So... What does it do?</h3> <p>Here's a comparison of a standard error message. The first one uses the built-in <strong>alert</strong>-function, while the second is using <strong>sweetAlert</strong>.</p> <div> <h4>Normal alert</h4> <button>Show error message</button> <h5>Code:</h5> <pre><span>alert</span>(<span>"Oops... Something went wrong!"</span>); </pre> <div></div> </div> <div> <h4>Sweet Alert</h4> <button>Show error message</button> <h5>Code:</h5> <pre><span>sweetAlert</span>(<span>"Oops..."</span>, <span>"Something went wrong!"</span>, <span>"error"</span>);</pre> </div> <p>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!</p> <h3>More examples</h3> <p>In these examples, we're using the shorthand function <strong>swal</strong> to call sweetAlert.</p> <ul> <li> <div> <p>A basic message</p> <button>Try me!</button> </div> <pre><span>swal</span>(<span>"Here's a message!"</span>)</pre> </li> <li> <div> <p>A title with a text under</p> <button>Try me!</button> </div> <pre><span>swal</span>(<span>"Here's a message!"</span>, <span>"It's pretty, isn't it"</span>)</pre> </li> <li> <div> <p>A success message!</p> <button>Try me!</button> </div> <pre><span>swal</span>(<span>"Good job!"</span>, <span>"You clicked the button!"</span>, <span>"success"</span>)</pre> </li> <li> <div> <p>A warning message, with a function attached to the "Confirm"-button...</p> <button>Try me!</button> </div>

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

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新Javascript教程学习
    热门Javascript教程学习
    编程开发子分类