<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>Bootstrap 實例 - 按鈕(Button)插件加載狀態(tài)</title> <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script></head><body><button id="fat-btn" class="btn btn-primary" data-loading-text="Loading..." type="button"> 加載狀態(tài)</button><script> $(function() { $(".btn").click(function(){ $(this).button('loading').delay(1000).queue(function() { $(this).button('reset'); //alert('123'); // $(this).dequeue(); }); }); }); </script>注釋掉dequeue依然會執(zhí)行reset。
為什么這個例子不需要dequeue就能執(zhí)行queue的隊列的函數(shù)
紅糖糍粑
2018-12-04 17:18:39