jquery SweetAlert插件實(shí)現(xiàn)響應(yīng)式提示框
jquery彈出層插件,支持消息提示、錯(cuò)誤提示、確認(rèn)框提示等。交互體驗(yàn)度非常好,大家都用微信支付、支付寶等完成用戶體驗(yàn)度非常的不錯(cuò)。本插件至少要支持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)式提示框,希望對(duì)大家有所幫助。
相關(guān)文章
js動(dòng)態(tài)往表格的td中添加圖片并注冊事件
這篇文章主要介紹了使用js動(dòng)態(tài)往表格的td中添加圖片并注冊事件,需要的朋友可以參考下2014-06-06詳解JavaScript如何實(shí)現(xiàn)更短時(shí)間的延時(shí)函數(shù)
在項(xiàng)目開發(fā)中,經(jīng)常能遇到需要延時(shí)執(zhí)行的需求,比如實(shí)現(xiàn)一個(gè)定時(shí)器功能,本文主要和大家介紹了JS如何實(shí)現(xiàn)更短時(shí)間的延時(shí)函數(shù),需要的可以參考下2024-03-03怎么理解wx.navigateTo的events參數(shù)使用詳情
這篇文章主要介紹了怎么理解wx.navigateTo的events參數(shù)使用詳情,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-05-05微信小程序之幾種常見的彈框提示信息實(shí)現(xiàn)詳解
這篇文章主要介紹了微信小程序之幾種常見的彈框提示信息實(shí)現(xiàn)詳解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2019-07-07webpack4手動(dòng)搭建Vue開發(fā)環(huán)境實(shí)現(xiàn)todoList項(xiàng)目的方法
這篇文章主要介紹了webpack4手動(dòng)搭建Vue開發(fā)環(huán)境實(shí)現(xiàn)todoList項(xiàng)目的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2019-05-05Javascript獲取統(tǒng)一管理的提示語(message)
這篇文章主要介紹了Javascript獲取統(tǒng)一管理的提示語(message)的相關(guān)資料,需要的朋友可以參考下2016-02-02JavaScript高級(jí)程序設(shè)計(jì) 錯(cuò)誤處理與調(diào)試學(xué)習(xí)筆記
JavaScript高級(jí)程序設(shè)計(jì) 錯(cuò)誤處理與調(diào)試學(xué)習(xí)筆記,學(xué)習(xí)js的朋友可以參考下。2011-09-09