純JavaScript基于notie.js插件實(shí)現(xiàn)消息提示特效
本文實(shí)例介紹了純JavaScript實(shí)現(xiàn)消息提示特效是一款基于notie.js插件實(shí)現(xiàn)的可以制作Alert提示框,確認(rèn)框和帶輸入的消息框,分享給大家供大家參考,具體內(nèi)容如下
效果圖:
實(shí)現(xiàn)的代碼:
html代碼:
<br><br><br><br><br><br> <article class="zzsc"> <div class="div-ext"> <div class="div-int"> <span>Test notie with these buttons:</span> <br> <button onclick="success();">Success</button> <button onclick="warning();">Warning</button> <button onclick="error();">Error</button><br> <button onclick="info();">Information</button> <button onclick="confirm();">Confirm</button> <button onclick="input();">Input</button> <br> </div> </div> </article>
js代碼:
function success() { notie.alert(1, 'Success!', 2); } function warning() { notie.alert(2, 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>', 2); } function error() { notie.alert(3, 'Error.', 2); } function info() { notie.alert(4, 'Information.', 2); } function confirm() { notie.confirm('Are you sure you want to do that?<br><b>That\'s a bold move...</b>', 'Yes', 'Cancel', function () { notie.alert(1, 'Good choice!', 2); }); } function input() { notie.input('Please enter your email address:', 'Submit', 'Cancel', 'email', 'name@example.com', function (value_entered) { notie.alert(1, 'You entered: ' + value_entered, 2); }); }
希望本文所述對(duì)大家學(xué)習(xí)javascript程序設(shè)計(jì)有所幫助。
相關(guān)文章
淺談javascript的call()、apply()、bind()的用法
這篇文章主要為大家詳細(xì)介紹了javascript的call()、apply()、bind()的用法,探討JavaScript中函數(shù)的一些特殊用法,感興趣的小伙伴們可以參考一下2016-02-02js控制輸入框獲得和失去焦點(diǎn)時(shí)狀態(tài)顯示的方法
這篇文章主要介紹了js控制輸入框獲得和失去焦點(diǎn)時(shí)狀態(tài)顯示的方法,可實(shí)現(xiàn)判斷輸入框的焦點(diǎn)狀態(tài)設(shè)置不同樣式的功能,是非常實(shí)用的技巧,需要的朋友可以參考下2015-01-01基于Ionic3實(shí)現(xiàn)選項(xiàng)卡切換并重新加載echarts
這篇文章主要介紹了基于Ionic3實(shí)現(xiàn)選項(xiàng)卡切換并重新加載echarts,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-09-09JS實(shí)現(xiàn)的簡(jiǎn)單下拉框聯(lián)動(dòng)功能示例
這篇文章主要介紹了JS實(shí)現(xiàn)的簡(jiǎn)單下拉框聯(lián)動(dòng)功能,涉及javascript事件響應(yīng)及頁(yè)面元素屬性動(dòng)態(tài)修改相關(guān)操作技巧,需要的朋友可以參考下2018-05-05