1. <i id='r23AX'><tr id='r23AX'><dt id='r23AX'><q id='r23AX'><span id='r23AX'><b id='r23AX'><form id='r23AX'><ins id='r23AX'></ins><ul id='r23AX'></ul><sub id='r23AX'></sub></form><legend id='r23AX'></legend><bdo id='r23AX'><pre id='r23AX'><center id='r23AX'></center></pre></bdo></b><th id='r23AX'></th></span></q></dt></tr></i><div id='r23AX'><tfoot id='r23AX'></tfoot><dl id='r23AX'><fieldset id='r23AX'></fieldset></dl></div>
      <legend id='r23AX'><style id='r23AX'><dir id='r23AX'><q id='r23AX'></q></dir></style></legend>

      <small id='r23AX'></small><noframes id='r23AX'>

    2. <tfoot id='r23AX'></tfoot>

        <bdo id='r23AX'></bdo><ul id='r23AX'></ul>

        页面加载完成时打开 css 弹出窗口

        open css popup when page loads completed(页面加载完成时打开 css 弹出窗口)

        <tfoot id='YkCBj'></tfoot>

              <tbody id='YkCBj'></tbody>
              <bdo id='YkCBj'></bdo><ul id='YkCBj'></ul>
                <legend id='YkCBj'><style id='YkCBj'><dir id='YkCBj'><q id='YkCBj'></q></dir></style></legend>

                  <i id='YkCBj'><tr id='YkCBj'><dt id='YkCBj'><q id='YkCBj'><span id='YkCBj'><b id='YkCBj'><form id='YkCBj'><ins id='YkCBj'></ins><ul id='YkCBj'></ul><sub id='YkCBj'></sub></form><legend id='YkCBj'></legend><bdo id='YkCBj'><pre id='YkCBj'><center id='YkCBj'></center></pre></bdo></b><th id='YkCBj'></th></span></q></dt></tr></i><div id='YkCBj'><tfoot id='YkCBj'></tfoot><dl id='YkCBj'><fieldset id='YkCBj'></fieldset></dl></div>

                  <small id='YkCBj'></small><noframes id='YkCBj'>

                  本文介绍了页面加载完成时打开 css 弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有 pure css popup 这个 pop 可以在点击按钮上工作,但是我需要在页面加载完成时弹出这个 div

                  I have pure css popup this pop works onclick button but i need to pop this div when page load is completed

                  <div class="wrap">
                          <a href="#modal-one" class="btn btn-big">Modal!</a>
                      </div>
                      <!-- Modal -->
                      <div class="modal" id="modal-one" aria-hidden="true">
                          <div class="modal-dialog">
                              <div class="modal-header">
                                  <h2>Modal in CSS?</h2>
                                  <a href="#" class="btn-close" aria-hidden="true">×</a>
                              </div>
                              <div class="modal-body">
                                  <p>One modal example here! :D</p>
                              </div>
                              <div class="modal-footer">
                                  <a href="#" class="btn">Nice!</a>
                              </div>
                          </div>
                      </div>
                  

                  Jsfiddle

                  当页面加载时,我需要自动弹出这个窗口,然后点击第二个选项

                  Jsfiddle

                  when page is loaded i need to pop this window automatically and 2nd option by click

                  谁能帮帮我

                  推荐答案

                  一种选择是使用 javascript 并为新类添加额外的规则.

                  One option is to use javascript and add the extra rules for new class.

                  CSS:

                  .modal:target:before, .modal.loaded:before { ... }
                  .modal:target .modal-dialog, .modal.loaded .modal-dialog { ... }
                  

                  Js:

                  $( document ).ready( function() {
                      $('.modal').addClass('loaded');
                      $('.btn-close, .btn').click( function() {
                          $('.modal').removeClass('loaded');
                      });
                  });
                  

                  小提琴:http://jsfiddle.net/ycc7anhy/2/

                  唯一的 css 解决方案是 :target url 用于关闭弹出窗口.

                  A css only solution is to :target url for closing popup.

                  .modal:target:before {
                      display: none;
                  }
                  .modal:before {
                      content:"";
                      display: block;
                      background: rgba(0, 0, 0, 0.6);
                      position: fixed;
                      top: 0;
                      left: 0;
                      right: 0;
                      bottom: 0;
                      z-index: 10;
                  }
                  .modal .modal-dialog {
                      background: #fefefe;
                      border: #333333 solid 1px;
                      border-radius: 5px;
                      margin-left: -200px;
                      position: fixed;
                      left: 50%;
                      z-index: 11;
                      width: 360px;
                      -webkit-transform: translate(0, 0);
                      -ms-transform: translate(0, 0);
                      transform: translate(0, 0);
                      -webkit-transition: -webkit-transform 0.3s ease-out;
                      -moz-transition: -moz-transform 0.3s ease-out;
                      -o-transition: -o-transform 0.3s ease-out;
                      transition: transform 0.3s ease-out;
                      top: 20%;
                  }
                  .modal:target .modal-dialog {
                      top: -100%;
                      -webkit-transform: translate(0, -500%);
                      -ms-transform: translate(0, -500%);
                      transform: translate(0, -500%);
                  }
                  

                  小提琴:http://jsfiddle.net/ycc7anhy/7/

                  这篇关于页面加载完成时打开 css 弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Plot data in website from multiple csv file(从多个 csv 文件中绘制网站中的数据)
                  Content Service for Google Apps Script returning HTML instead of JSON(返回 HTML 而不是 JSON 的 Google Apps 脚本的内容服务)
                  Open page in new window without popup blocking(在新窗口中打开页面而不阻止弹出窗口)
                  Javascript Confirm popup Yes, No button instead of OK and Cancel(Javascript 确认弹出窗口是,否按钮而不是确定和取消)
                  Opensource/free HTML5/CSS3/JavaScript IDE?(开源/免费 HTML5/CSS3/JavaScript IDE?)
                  jump to CSS selector in a css file from the HTML file in Vim using a single keystroke(使用单次击键从 Vim 中的 HTML 文件跳转到 CSS 文件中的 CSS 选择器)

                    <i id='KT7mQ'><tr id='KT7mQ'><dt id='KT7mQ'><q id='KT7mQ'><span id='KT7mQ'><b id='KT7mQ'><form id='KT7mQ'><ins id='KT7mQ'></ins><ul id='KT7mQ'></ul><sub id='KT7mQ'></sub></form><legend id='KT7mQ'></legend><bdo id='KT7mQ'><pre id='KT7mQ'><center id='KT7mQ'></center></pre></bdo></b><th id='KT7mQ'></th></span></q></dt></tr></i><div id='KT7mQ'><tfoot id='KT7mQ'></tfoot><dl id='KT7mQ'><fieldset id='KT7mQ'></fieldset></dl></div>
                    <legend id='KT7mQ'><style id='KT7mQ'><dir id='KT7mQ'><q id='KT7mQ'></q></dir></style></legend>

                      <small id='KT7mQ'></small><noframes id='KT7mQ'>

                          <tbody id='KT7mQ'></tbody>
                        <tfoot id='KT7mQ'></tfoot>

                          • <bdo id='KT7mQ'></bdo><ul id='KT7mQ'></ul>