Jquery实现loading效果


需要引入jquery和bootstrap相关包,然后把下面的代码复制进去就可以了:

<div class="modal fade" id="loadingModal" backdrop="static" keyboard="false">
  <div style="width: 200px;height:20px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
    <div class="progress progress-striped active" style="margin-bottom: 0;">
      <div class="progress-bar" style="width: 100%;"></div>
    </div>
    <h5>loading...</h5>
  </div>
</div>
<script>
  showLoading = function(){
    $('#loadingModal').modal({backdrop: 'static', keyboard: false});
  }
  hideLoading = function(){
    $('#loadingModal').modal('hide');
  }
</script>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM