jquery SweetAlert插件實(shí)現(xiàn)響應(yīng)式提示框
jquery彈出層插件,支持消息提示、錯誤提示、確認(rèn)框提示等。交互體驗(yàn)度非常好,大家都用微信支付、支付寶等完成用戶體驗(yàn)度非常的不錯。本插件至少要支持IE9+。使用方式也非常的簡單、粗暴,很符合大眾的jquery插件使用方法。
先給大家演示效果:
代碼如下:
<h1>Sweet Alert</h1> <h2>A beautiful replacement for JavaScript's "Alert"</h2> <button class="download">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 class="showcase normal"> <h4>Normal alert</h4> <button>Show error message</button> <h5>Code:</h5> <pre><span class="attr">alert</span>(<span class="str">"Oops... Something went wrong!"</span>); </pre> <div class="vs-icon"></div> </div> <div class="showcase sweet"> <h4>Sweet Alert</h4> <button>Show error message</button> <h5>Code:</h5> <pre><span class="attr">sweetAlert</span>(<span class="str">"Oops..."</span>, <span class="str">"Something went wrong!"</span>, <span class="str">"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 class="center">In these examples, we're using the shorthand function <strong>swal</strong> to call sweetAlert.</p> <ul class="examples"> <li class="message"> <div class="ui"> <p>A basic message</p> <button>Try me!</button> </div> <pre><span class="attr">swal</span>(<span class="str">"Here's a message!"</span>)</pre> </li> <li class="title-text"> <div class="ui"> <p>A title with a text under</p> <button>Try me!</button> </div> <pre><span class="attr">swal</span>(<span class="str">"Here's a message!"</span>, <span class="str">"It's pretty, isn't it?"</span>)</pre> </li> <li class="success"> <div class="ui"> <p>A success message!</p> <button>Try me!</button> </div> <pre><span class="attr">swal</span>(<span class="str">"Good job!"</span>, <span class="str">"You clicked the button!"</span>, <span class="str">"success"</span>)</pre> </li> <li class="warning confirm"> <div class="ui"> <p>A warning message, with a function attached to the "Confirm"-button...</p> <button>Try me!</button> </div>
以上就是本文通過代碼給大家詳解jquery SweetAlert插件實(shí)現(xiàn)響應(yīng)式提示框,希望對大家有所幫助。
相關(guān)文章
在Layui中操作數(shù)據(jù)表格,給指定單元格添加事件示例
今天小編就為大家分享一篇在Layui中操作數(shù)據(jù)表格,給指定單元格添加事件示例,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-10-10
js實(shí)現(xiàn)倒計(jì)時效果(小于10補(bǔ)零)
本文主要介分享了js實(shí)現(xiàn)倒計(jì)時效果(小于10補(bǔ)零)的實(shí)例代碼,具有很好的參考價(jià)值。下面跟著小編一起來看下吧2017-03-03
JS實(shí)現(xiàn)同一個網(wǎng)頁布局滑動門和TAB選項(xiàng)卡實(shí)例
這篇文章主要介紹了JS實(shí)現(xiàn)同一個網(wǎng)頁布局滑動門和TAB選項(xiàng)卡效果,通過簡單的自定義切換函數(shù)setTab實(shí)現(xiàn)頁面元素的遍歷及屬性切換的功能,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-09
JS中typeof與instanceof之間的區(qū)別總結(jié)
本文是對JS中typeof與instanceof之間的區(qū)別進(jìn)行了詳細(xì)的總結(jié)介紹,需要的朋友可以過來參考下,希望對大家有所幫助2013-11-11

