dialog彈出框

js

<script src="/${res}/agency/js/jquery.min.js"></script>
<script type="text/javascript">
  //主方法
  msgAlert();
  //定時關閉提示框
  function closeMsg(){
    $('#msg-alert').hide();
  }
  function msgAlert(){
    $('#msg-alert').show();
    //使用方法名字執行方法 
    window.setTimeout(closeMsg,1500);
  }
</script>

css

<style type="text/css">
  #msg-alert {
    z-index: 9999;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 182px;
    height: 82px;
    margin-left: -91px;
    margin-top: -41px;
    border-radius: 2px;
    background-color: #2a2a2a;
    display: none;
    box-shadow: 0 0 1px #666;
    opacity: 0.9;
    text-align: center;
    line-height: 82px;
    color: #fff;
    font-size: 18px;
    font-family: "微軟雅黑"
  }
</style>

html

<span id="msg-alert">
  <span class="glyphicon glyphicon-info-sign" style="font-weight:100;"></span> 手機號不能爲空
</span>

效果圖

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章