1 .fakeLoader { 2 position:fixed; 3 width:100%; 4 height:100%; 5 left:0; 6 top:0; 7 z-index:9999999999 8 }
1 <!DOCTYPE html> 2 <head> 3 <meta charset="utf-8"> 4 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 5 <title>DEMO4</title> 6 7 </head> 8 <body> 9 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 10 <script src="js/fakeLoader.min.js"></script> 11 <script> 12 $(document).ready(function(){ 13 $("button[class=‘btn btn-primary‘]").click(function(){ 14 $("<link>") 15 .attr({ rel: "stylesheet", 16 type: "text/css", 17 href: "css/fakeLoader.min.css" 18 }) 19 .appendTo("head"); 20 $.fakeLoader({ 21 timeToHide:12000, 22 bgColor:"#34495e", 23 spinner:"spinner3" 24 }); 25 }); 26 }); 27 </script> 28 <div class="fakeLoader"></div> 29 <button class="btn btn-primary">adf </button> 30 </body> 31 </html>
问题解决:fakeLoader无法实现点击button然后在弹出加载动画
原文:https://www.cnblogs.com/smartisn/p/14701376.html