jquery實現(xiàn)加載更多"轉(zhuǎn)圈圈"效果(示例代碼)
功能:發(fā)送網(wǎng)絡(luò)請求時等待加載的圈圈動態(tài)顯示,網(wǎng)絡(luò)請求成功后關(guān)閉提示圈圈
代碼:
index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>css畫動態(tài)等待轉(zhuǎn)圈效果</title> <link rel="stylesheet" href="public/index.css" rel="external nofollow" > </head> <style type="text/css"> .toast { display: none; position: fixed; flex-direction: column; justify-content: center; align-items: center; width: 18rem; height: 18rem; left: 50%; top: 50%; transform: translate(-50%, -50%); background-color: #4A4A4B; border-radius: 1rem; color: #f0f0f0; font-size: 2.5rem; } .load { display: inline-block; margin-bottom: 1.5rem; height: 4rem; width: 4rem; border: 0.4rem solid transparent; border-top-color: white; border-left-color: white; border-bottom-color: white; animation: circle 1s infinite linear; -webkit-animation: circle 1s infinite linear; /* Safari 和 Chrome */ border-radius: 50% } @-webkit-keyframes circle { 0% { transform: rotate(0deg); } 100% { transform: rotate(-360deg) } } </style> <body> <div class="toast"> <span class="load"></span> <span>加載中...</span> </div> <script src="public/jquery.min.js"></script> <script> $(function () { $('.toast').css({display: 'flex'}) //這里可以寫網(wǎng)絡(luò)請求代碼... $.ajax({ url: '/api/login', type: 'POST', data: {username: '111'}, dataType: 'json', success: function (data) {//請求成功則關(guān)閉圈圈 $('.toast').css({display: 'none'}) }, error: function (e) { console.log(e) } }) }); </script> </body> </html>
效果:
到此這篇關(guān)于jquery實現(xiàn)加載更多“轉(zhuǎn)圈圈“效果的文章就介紹到這了,更多相關(guān)jquery加載更多轉(zhuǎn)圈圈內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
idTabs基于JQuery的根據(jù)URL參數(shù)選擇Tab插件
我們的項目用了SunSean的idTabs,但每個tab里的控件會觸發(fā)postback,或者轉(zhuǎn)到其他頁面再轉(zhuǎn)回來,這樣當(dāng)前選中的tab必丟。印度同事不肯用AJAX,無奈今天加班給印度人寫個demo,通過回傳URL參數(shù)來選擇tab2012-04-04基于jQuery實現(xiàn)Accordion手風(fēng)琴自定義插件
這篇文章主要為大家詳細(xì)介紹了基于jQuery實現(xiàn)Accordion手風(fēng)琴自定義插件,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-11-11jQuery使用動態(tài)渲染表單功能完成ajax文件下載
使用ajax實現(xiàn)文件下載,方便,快捷,時尚,多么有挑戰(zhàn)的一個功能,首先獲取url和data然后把參數(shù)組裝成form的input再利用request發(fā)送請求,也就是動態(tài)渲染表單,提交表單后再刪除,本例將實現(xiàn)文件下載功能,感興趣的朋友可以聊解下2013-01-01JavaScript的jQuery庫中function的存在和參數(shù)問題
這篇文章主要介紹了JavaScript的jQuery庫中function的存在和參數(shù)問題,包括function的參數(shù)傳遞和檢測一個jQuery方法是否存在等,需要的朋友可以參考下2015-08-08jquery實現(xiàn)隱藏與顯示動畫效果/輸入框字符動態(tài)遞減/導(dǎo)航按鈕切換
jquery實現(xiàn)隱藏顯示層動畫效果、仿新浪字符動態(tài)輸入、tab效果等等,以下為所有代碼,感興趣的朋友可以練練手哈,希望對大家學(xué)習(xí)有所幫助2013-07-07jquery 實現(xiàn)復(fù)選框的全選操作實例代碼
這篇文章主要介紹了jquery 實現(xiàn)復(fù)選框的全選操作實例代碼的相關(guān)資料,需要的朋友可以參考下2017-01-01jQuery+css實現(xiàn)的時鐘效果(兼容各瀏覽器)
這篇文章主要介紹了jQuery+css實現(xiàn)的時鐘效果,使用js的setTimeout方法實時修改頁面元素,實現(xiàn)動態(tài)顯示時鐘的功能.該代碼可兼容各瀏覽器,需要的朋友可以參考下2016-01-01