亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jQuery實現的兩種簡單彈窗效果示例

 更新時間:2018年04月18日 09:34:47   作者:包子源  
這篇文章主要介紹了jQuery實現的兩種簡單彈窗效果,結合實例形式分析了jQuery實現淡入彈窗及滑動彈窗的相關操作技巧,需要的朋友可以參考下

本文實例講述了jQuery實現的兩種簡單彈窗效果。分享給大家供大家參考,具體如下:

這里利用jquery實現兩種彈窗效果:

1. 淡入彈窗效果:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>chabaoo.cn jQuery彈窗</title>
    <style>
      *{padding: 0;margin: 0;}
      .box{width: 100%;height: 100%;}
      .main{width: 100%;height: 100%;background-color: rgba(0,0,0,0.8);display: none;position: fixed;z-index: 1;}
      .mainbox{width: 800px;height: 100%;margin: 0 auto;background-color: rgba(255,255,255,0.8);padding: 20px;}
      .kkk{width: 100%;height: 1200px;background-color: red;}
      .close{color: red;cursor: pointer;}
    </style>
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <script>
      $(function(){
        $(".btn").click(function(){
          $(".main").fadeIn();
        });
        $(".close").click(function(){
          $(".main").fadeOut();
        });
      });
    </script>
  </head>
  <body>
    <div class="main">
        <div class="mainbox">
          <div class="close">點擊關閉</div>
        </div>
      </div>
    <div class="box">
      <div class="kkk">
        <input class="btn" type="button" value="點擊淡入彈窗" />
      </div>
    </div>
  </body>
</html>

運行效果:

2. 滑動彈窗效果:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>chabaoo.cn jQuery彈窗</title>
    <style>
      *{padding: 0;margin: 0;}
      .box{width: 100%;height: 100%;}
      .main{width: 100%;height: 100%;background-color: rgba(0,0,0,0.8);display: none;position: fixed;z-index: 1;}
      .mainbox{width: 800px;height: 100%;margin: 0 auto;background-color: rgba(255,255,255,0.8);padding: 20px;display: none;}
      .kkk{width: 100%;height: 1200px;background-color: red;}
      .close{color: red;cursor: pointer;}
    </style>
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <script>
      $(function(){
        $(".btn").click(function(){
          $(".main").fadeIn();
          $(".mainbox").delay(500).slideDown();
        });
        $(".close").click(function(){
          $(".main").fadeOut();
        });
      });
    </script>
  </head>
  <body>
    <div class="main">
        <div class="mainbox">
          <div class="close">點擊關閉</div>
        </div>
      </div>
    <div class="box">
      <div class="kkk">
        <input class="btn" type="button" value="點擊淡入彈窗" />
      </div>
    </div>
  </body>
</html>

運行效果:

更多關于jQuery相關內容感興趣的讀者可查看本站專題:《jQuery窗口操作技巧總結》、《jQuery擴展技巧總結》、《jQuery常用插件及用法總結》、《jQuery表格(table)操作技巧匯總》、《jQuery常見經典特效匯總》及《jquery選擇器用法總結

希望本文所述對大家jQuery程序設計有所幫助。

相關文章

最新評論